views:

311

answers:

2

Hello,

I get to the very last linking command (the actual executable is being linked) but i get a BUNCH of undefined symbols (and they're in cpp and look so scary to me, a simple c programmer)

--its probably something simple but i cant get what im supposed to put as linker (its using gcc here...? is that appropriate? g++ told me too many input files lol) (ld returns much of the same)

anyway its ridiculous, i am completely stuck

thankyou for your help!

make
Making all in docs
Making all in en
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all-am'.
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0  -arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks  -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0 -I../include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk -O0  -arch armv6 -pipe -std=c99 -gdwarf-2 -mthumb -I../include -L../libs -L../../libs -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib  -o mutella  -L/usr/local/lib uilocalsocket.o gnumarkedfiles.o uitextmode.o sha1.o sha1thread.o gnuwordhash.o gnulogcentre.o asyncdns.o gnuwebcache.o uiterminal.o uiremote.o asyncproxysocket.o messages.o lineinput.o rcobject.o event.o term_help.o mprintf.o readline4fix.o asyncfile.o tstring.o dir.o inifile.o property.o byteorder.o mui.o gnusearch.o mthread_unix.o asyncsocket.o controller.o preferences.o packet.o gnuupload.o gnusock.o gnushare.o gnunode.o gnuhash.o gnudownload.o gnudirector.o gnucache.o conversions.o common.o main.o  -lpthread -lreadline -lcurses  -lpoll -lz
Undefined symbols:
  "std::__throw_bad_alloc()", referenced from:
      __gnu_cxx::new_allocator<std::_List_node<MUILSocketCommunicate*> >::allocate(unsigned long, void const*)in uilocalsocket.o
      __gnu_cxx::new_allocator<SMarkedFile>::allocate(unsigned long, void const*)in gnumarkedfiles.o
      __gnu_cxx::new_allocator<std::_List_node<long> >::allocate(unsigned long, void const*)in gnumarkedfiles.o
      __gnu_cxx::new_allocator<std::_Rb_tree_node<TString<char> > >::allocate(unsigned long, void const*)in gnumarkedfiles.o
      __gnu_cxx::new_allocator<std::_Rb_tree_node<long> >::allocate(unsigned long, void const*)in gnumarkedfiles.o
      __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<long const, MFileSizeClass> > >::allocate(unsigned long, void const*)in gnumarkedfiles.o
+3  A: 

Seems you are trying to link C++ code with a C (gcc) linker call. That'll not include the appropriate libraries which is just what you are seeing. Try g++ instead of gcc (or throw out the C++ code/libraries).

Thanks for that ( i did read this on google first! tried it but i picked the 'wrong' g++) did it again and it worked a charm. i have the exe i want but i have another q: when i try to change the cpp compiler in the config script it says the g++ im using fails the 'sanity check' i checked config.log but no help :S also because the make script wants to use gcc, how can i change it to always use g++ at that end linking? thanks for all your help!
lol
That sounds like you could accept this answer and ask a new question.
Georg Fritzsche
+2  A: 

Add -lstdc++ or use g++ for linking.

Andy
bingo thankyou!
lol