简体   繁体   English

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

[英]Linker error: undefined reference to `std::ctype<char>::_M_widen_init()

I am getting linker error while trying to run a sample project. 我在尝试运行示例项目时遇到链接器错误。 Could you let me know how can I fix this? 你能告诉我怎么解决这个问题?

Thanks in advance. 提前致谢。

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

It looks like it's part of the standard library that's mismatched here. 看起来它是标准库的一部分,在这里不匹配。 The two most likely answers I can think of: 我能想到的两个最可能的答案:

  • You didn't compile and link the entire project (including all libraries) with the same version of g++. 您没有使用相同版本的g ++编译和链接整个项目(包括所有库)。
  • The header/library paths you're using for the standard library mismatch, and you're getting the headers from one library version but the .so library from a different version. 您用于标准库不匹配的标头/库路径,并且您从一个库版本获取标头,但从不同版本获取.so库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接器错误:对`std :: ctype的未定义引用 <char> 来自静态库的:: _ M_widen_init()。 即使使用相同的gcc版本 - Linker error : undefined reference to `std::ctype<char>::_M_widen_init() from static lib. even with same gcc version C ++ std :: ctype <char> :: widen()的作用是什么? - C++ What is the role of std::ctype<char>::widen()? g ++链接器错误:为std :: hash获取未定义的引用错误 - g++ linker error: Getting undefined reference error for std::hash C ++ [链接器错误]未定义对`performComputation(char,double)&#39;的引用 - C++ [Linker error] undefined reference to `performComputation(char, double)' 链接器错误:引用未定义 - Linker Error: Undefined reference 链接器错误-未定义参考 - Linker error - undefined reference 未定义的参考链接器错误 - undefined reference linker error [链接器错误]未定义引用`Set <std::string> :: contains(std :: string const&)const&#39; - [Linker error] undefined reference to `Set<std::string>::contains(std::string const&) const' 对函数的未定义引用(链接器错误) - Undefined reference to function (linker error) g ++编译错误:std :: ctype <char> ,std :: __ detail,std :: allocator - g++ compiling error: std::ctype<char>, std::__detail, std::allocator<Taquart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM