链接器错误:对`std :: ctype <char> :: _ M_widen_init()</char>的未定义引用

时间:2010-10-27 16:28:25

标签: c++ c

我在尝试运行示例项目时遇到链接器错误。你能告诉我怎么解决这个问题吗?

提前致谢。

make[1]: Entering directory `/home/rumi/MobiusProject/Multiproc-Paper/Transformer/ssg'
/usr/bin/g++ -w -DMOBIUS_LITTLE_ENDIAN -DMOBIUS_LINUX -m32 -o ssgGen_Linux    -L../../lib/Linux_lib/  -L/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/lib/Linux_lib  -L/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/external/lib/Linux -L../../external/lib/Linux -lgenMain -lgen  -lvary_num_compRangeStudy -lmulti_proc_PVPV -lmulti_procRJ -lmemory_moduleSAN -lcpu_moduleSAN -lio_port_moduleSAN -lerrorhandlersSAN   -lTRex -lStudy -lPV -lComposer_RepJoin -lSAN -lbase -lstate -lmobutil -ldist  -lstdc++ -lcrypto -lpthread -lm

make[1]: Leaving directory `/home/rumi/MobiusProject/Multiproc-Paper/Transformer/ssg'
make: Leaving directory `/home/rumi/MobiusProject/Multiproc-Paper/Transformer/ssg'

/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/lib/Linux_lib/libgenMain.a(Main.o): In function `commandline(int, char**, int&, char*&, char*&)':
Main.cpp:(.text+0x494): undefined reference to `std::ctype::_M_widen_init() const'
Main.cpp:(.text+0x4b1): undefined reference to `std::ctype::_M_widen_init() const'
Main.cpp:(.text+0x584): undefined reference to `std::ctype::_M_widen_init() const'
/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/lib/Linux_lib/libgenMain.a(Main.o): In function `main':
Main.cpp:(.text+0x894): undefined reference to `std::ctype::_M_widen_init() const'
Main.cpp:(.text+0x8b4): undefined reference to `std::ctype::_M_widen_init() const'
/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/lib/Linux_lib/libStudy.a(BaseStudyClass.o):BaseStudyClass.cpp:(.text+0x5c4): more undefined references to `std::ctype::_M_widen_init() const' follow
collect2: ld returned 1 exit status
make[1]: *** [exec3] Error 1
make: *** [opt] Error 2

1 个答案:

答案 0 :(得分:9)

看起来它是标准库的一部分,在这里不匹配。我能想到的两个最可能的答案是:

  • 您没有使用相同版本的g ++编译和链接整个项目(包括所有库)。
  • 您用于标准库不匹配的标头/库路径,并且您从一个库版本获取标头,但从不同版本获取.so库。