Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ gcc 5.2.1\u GLIBCXX\u使用\u CXX11\u ABI_C++ - Fatal编程技术网

C++ gcc 5.2.1\u GLIBCXX\u使用\u CXX11\u ABI

C++ gcc 5.2.1\u GLIBCXX\u使用\u CXX11\u ABI,c++,C++,编辑:我使用的是gcc 5.2.1,因此显然,默认情况下选择了新的libstdc++库ABI。当我试图编译代码时,可能是问题导致了此错误消息(与std::_cxx11相关): /tmp/ccVIU5fG.o: In function `main': 2D_interpolations.cc:(.text+0x76): undefined reference to `mio::Config::Config(std::__cxx11::basic_string<char, std::char_

编辑:我使用的是gcc 5.2.1,因此显然,默认情况下选择了新的libstdc++库ABI。当我试图编译代码时,可能是问题导致了此错误消息(与std::_cxx11相关):

/tmp/ccVIU5fG.o: In function `main':
2D_interpolations.cc:(.text+0x76): undefined reference to `mio::Config::Config(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
2D_interpolations.cc:(.text+0x151): undefined reference to `mio::IOUtils::convertString(mio::Date&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double const&, std::ios_base& (*)(std::ios_base&))'
然后我就可以编译了。但我得到了一个与未定义符号相关的错误。利用

c++filt <the undefined symbol>
c++过滤器
事实证明,未定义的符号实际上是在添加#define(定义)GLIBCXX(使用)CXX11(ABI 0)之前出现错误的同一位置未定义的

mio::Config::Config(std::basic_string const&)
通过检查是否存在其他未定义的符号,我发现其中也缺少一个(同样在前面的错误中)

mio::IOUtils::convertString(mio::Date&,std::basic\u string const&,double const&,std::ios\u base&(*)(std::ios\u base&)
我知道已经有一些类似的帖子了,但是我的回答太“理论”了,因为我刚开始学C++,我在电脑上什么都不懂。如果你有任何可以帮助的建议,欢迎


谢谢

我终于解决了所有问题,所以我在这里发布了解决方案,以防有人感兴趣

为了检查我在代码中使用的库,我使用了以下命令

ldd -r -d <name of my code file>
ldd-r-d
已通过路径正确检测到使用的第三方lib Im

/usr/local/lib/<name of the library file>
/usr/local/lib/
但这显然不是一条好的道路(别问我为什么),即使被认可。一个好的选择是将库文件更改到另一个位置:

/usr/lib/<name of the library file>
/usr/lib/

它现在工作得很好

正如@zenith所指出的,这是一个副本。当您查看原始问题的答案时,请特别注意与以下内容相关的答案:_GLIBCXX_USE_cx11_ABI(如果您使用的是gcc 5.1或更新版本),谢谢@lobudge!在对这个主题进行了一些研究之后,它似乎与我的情况相关,因为我使用的是gcc版本5.2.1。但我不知道如何修复它。。。我读到的所有相关答案都是理论性的,我不是一名真正的计算机工程师!我会继续搜索,但如果你有任何建议,请告诉我!
ldd -r -d <name of my code file>
/usr/local/lib/<name of the library file>
/usr/lib/<name of the library file>