我正在 CentOS7/gcc5.5 上为一个项目构建 C++ 代码,该项目试图在链接过程中链接静态库。更准确地说,它是作为 .net sdk 版本 6.0 的一部分安装的 .net 库。
它现在在这里
/usr/share/dotnet/packs/Microsoft.NETCore.App.Host.linux-x64/6.0.2/runtimes/linux-x64/native/libnethost.a
从我将其复制到的位置我的工作区中的自定义路径
主项目有多个静态库,它在链接期间尝试链接。但是,仅对于此 libnethost.a
我收到以下错误
/home/customPath/ThirdParty/dotNet/6.0.1/libnethost.a(fx_ver.cpp.o): 在函数 ` fx_ver_t::as_str() const': /root/runtime/src/native/corehost/fxr/fx_ver.cpp:73: 未定义的引用`std::basic_stringstream、std::allocator; >::basic_stringstream()' /home/customPath/ThirdParty/dotNet/6.0.1/libnethost.a(fx_ver.cpp.o): 在函数 `fx_ver_t::prerelease_glob() const' 中:
这是系统上存在的 C++ 版本
libstdc++-4.8.5-44.el7.i686
libstdc++-devel-4.8.5-44.el7.x86_64
libstdc++-4.8.5-44.el7.x86_64
libstdc++-devel-4.8.5-44.el7.i686
请原谅我出现任何明显的错误,但我不太清楚编译器如何在 Linux 上工作。我读到 gcc5 与以前的版本相比使用了不同的 ABI,但我不确定它是如何工作的。请帮我解决这个问题。
问候
阿布舍克
I am building my C++ code on CentOS7/gcc5.5 for a project which is trying to link a static library during the linking process. To be more precise, its a .net library installed as part of .net sdk version 6.0.
Its present here
/usr/share/dotnet/packs/Microsoft.NETCore.App.Host.linux-x64/6.0.2/runtimes/linux-x64/native/libnethost.a
from where I have copied it to a custom path in my workspace
The main project has more than one static libraries which it tries to link during linking. However only for this libnethost.a
I am getting the below errors
/home/customPath/ThirdParty/dotNet/6.0.1/libnethost.a(fx_ver.cpp.o): In function `fx_ver_t::as_str() const': /root/runtime/src/native/corehost/fxr/fx_ver.cpp:73: undefined reference to `std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' /home/customPath/ThirdParty/dotNet/6.0.1/libnethost.a(fx_ver.cpp.o): In function `fx_ver_t::prerelease_glob() const':
This is the version of C++ present on the system
libstdc++-4.8.5-44.el7.i686
libstdc++-devel-4.8.5-44.el7.x86_64
libstdc++-4.8.5-44.el7.x86_64
libstdc++-devel-4.8.5-44.el7.i686
Excuse me for any obvious mistakes but I am not very clear about how the compiler works with Linux. I read about gcc5 using different ABI compared to previous versions but I am not sure how that works. Please help me figure this out.
Regards
Abhishek
发布评论