在Travis CI的Boost上未定义对`std :: __ cxx11 :: basic_string的引用 [英] undefined reference to `std::__cxx11::basic_string in Boost on Travis CI
问题描述
首先,我尝试了ubuntu上的软件包和PPA,但是他们试图在GitHub上使用Boost来正确编译Travis CI。 (我至少需要Boost 1.61)。
我只有在我编译过Travis CI(下载,编译)Boost时才能使用它,但不幸的是,编译时间很长(11-18分钟),并且日志文件很大。
想想如何克服这个问题,我想到了在我的机器上编译boost ,压缩,上传到某些网络服务器,只需下载和复制/ usr / local / [include / lib]相应的文件即可。
这里是我在机器上使用的编译器。我使用 ./ bootstrap.sh --prefix = / home / andrei / boostabc
/ usr / bin / time ./b2 install link = static
这里是travis文件(和存储库)。在评论中是我编译boost的方式。
问题是我收到很多错误:
/usr/local/lib/libboost_filesystem.a(operations.o):在函数中(匿名命名空间):: dir_itr_first(void *&;; void *&; char const *,std :: __ cxx11 :: basic_string< char,std :: char_traits< char> ;, std :: allocator< char>>&,boost :: filesystem :: file_status&,boost :: filesystem :: file_status& )[clone .isra.46] [clone .constprop.56]':
pre>
operations.cpp :(。text + 0xa8):未定义的对std :: __ cxx11 :: basic_string的引用< char,std :: char_traits< ; char>,std :: allocator< char> > :: _ M_assign(std :: __ cxx11 :: basic_string< char,std :: char_traits< char> ;, std :: allocator< char>> const&)'
我搜索了这个错误,我发现可能存在有关C ++ 11 ABI和宏的错误配置。我不太了解这个解释,我也不知道如何让它工作。
如果您能指引我正确的方向,我将不胜感激解决此问题。
解决方案您应该尝试在用于编译它的命令行中添加-D_GLIBCXX_USE_CXX11_ABI = 0,并查看是否这可以解决这个问题。
我认为你所调用的g ++ / gcc其中一个不是版本6是非常可能的,否则这将是设置为1默认iirc。
I am trying to get a C+++ project which uses Boost on GitHub to compile correctly on Travis CI.
First I tried the packages and PPAs on ubuntu, but they were too old(I need at least Boost 1.61).
I got it to work only if I compiled Boost on Travis CI(download, compile), but, unfortunately, the compile time is big (11-18 mins) and the log file is just huge.
Thinking how to get over this issues, I thinked about compiling boost on my machine, zipping, uploading to some web server and just downloading and copying on /usr/local/[include/lib] the corresponding files.
Here is the compiler I used on my machine. I compiled boost using
./bootstrap.sh --prefix=/home/andrei/boostabc /usr/bin/time ./b2 install link=static
Here is the travis file (and repository). In comments is the way I did it with compiling boost.
The problem is that I get a lot of errors:
/usr/local/lib/libboost_filesystem.a(operations.o): In function `(anonymous namespace)::dir_itr_first(void*&, void*&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, boost::filesystem::file_status&, boost::filesystem::file_status&) [clone .isra.46] [clone .constprop.56]': operations.cpp:(.text+0xa8): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
I googled this errors and I found there might be a misconfig about some C++11 ABI and a macro. I didn't understand very well the explanation and I do not have any idea how to get it working.
I would be grateful if you could point me in the right direction of solving this.
解决方案You should try the adding -D_GLIBCXX_USE_CXX11_ABI=0 to the command line used to compile it, and see if this gets rid of the problem.
I think its quite possible that one or other of the g++/gcc you are calling is not version 6 ... otherwise this would be set to 1 by default iirc.
这篇关于在Travis CI的Boost上未定义对`std :: __ cxx11 :: basic_string的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!