• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: undefined symbols
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined symbols


  • Subject: Re: undefined symbols
  • From: Chris Espinosa <email@hidden>
  • Date: Tue, 9 Dec 2008 22:16:32 -0800


On Dec 9, 2008, at 10:10 PM, Nathan Sturtevant wrote:

I have a project which I usually compile from XCode, but I also have makefiles set up for Linux users. The makefiles compile without issue on a linux box, but when I try to compile them on my mac, I can't get things to work. The XCode project compiles without issue.

The offending command is below. I've tried all variations of ordering between the different libraries (these are all statically linked with "ar -csr"). For instance, I'm failing on something from the map code, which is in the util library. It doesn't matter if I list that first or last, I still get the same error. This is only the first few errors; there are many others.

Any suggestions would be greatly appreciated.

		Nathan

g++ -o ../../../../bin/debug/sample -L../../../../bin/debug - framework Foundation -framework AppKit -framework GLUT -framework OpenGL -g ../../../../objs/sample/debug/apps/pathsample/Sample.o - lshared -labstraction -lgraph -labstractionalgorithms -lenvironments -lmapalgorithms -lalgorithms -labsmapalgorithms -lgraphalgorithms - lgui -lutil
Undefined symbols:
"Map::adjacentEdges(long, long, tEdge) const", referenced from:
AddMapEdges(Map*, Graph*, int, int)in libabstraction.a(MapAbstraction.o)
AddMapEdges(Map*, Graph*, int, int)in libabstraction.a(MapAbstraction.o)
GetMapGraph(Map*) in libabstraction.a(MapAbstraction.o)
"bitVector::bitVector(int)", referenced from:
BaseMapOccupancyInterface::BaseMapOccupancyInterface(Map*)in libenvironments.a(Map2DEnvironment.o)


<...>

ld: symbol(s) not found

1) Prove to yourself it's in the util library with nm.
2) Pass through -t to the linker to make sure the right libutil is being picked up (The linker will by default prefer libuitl.dylib; if you want libutil.a, you need to specify it by absolute path and full name)
3) Make sure the callers are including the util header wrapped in extern "C" { } or else the linker will be looking for mangled names in libutil


Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: undefined symbols
      • From: Nathan Sturtevant <email@hidden>
References: 
 >undefined symbols (From: Nathan Sturtevant <email@hidden>)

  • Prev by Date: undefined symbols
  • Next by Date: RE: Xcode - GDB console trouble (SOLVED but still puzzled)
  • Previous by thread: undefined symbols
  • Next by thread: Re: undefined symbols
  • Index(es):
    • Date
    • Thread