Re: undefined symbols
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