1

我得到了最后一个链接命令(实际的可执行文件正在被链接),但我得到了一堆未定义的符号(它们在 cpp 中,对我来说看起来很可怕,一个简单的 c 程序员)

- 它可能很简单,但我无法得到我应该作为链接器放置的内容(它在这里使用 gcc ...?这合适吗?g++ 告诉我太多输入文件哈哈)(ld 返回大部分相同)

无论如何这很荒谬,我完全被困住了

感谢您的帮助!

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
4

2 回答 2

4

似乎您正在尝试将 C++ 代码与 C (gcc) 链接器调用链接。这不包括您所看到的适当的库。尝试使用 g++ 而不是 gcc(或丢弃 C++ 代码/库)。

于 2010-01-13T12:05:14.857 回答
4

添加-lstdc++或使用 g++ 进行链接。

于 2010-01-13T12:29:23.540 回答