提高1.51:"错误:无法链接对boost_thread"! [英] Boost 1.51 : "error: could not link against boost_thread !"

查看:1185
本文介绍了提高1.51:"错误:无法链接对boost_thread"!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了袖扣升压后,我跑的./configure。我收到以下错误:

 在-lboost_thread检查出口,没有
检查中-lboost_thread ...(缓存)不退出
检查中-lboost_thread ...(缓存)不退出
错误:无法对boost_thread联系!


解决方案

检查您的config.log,它会告诉你更详细的失败原因:

 配置:11032:检查在-lboost_thread退出
配置:11057:G ++ -o conftest -I /家庭/ jcomeau /包括-Wstack保护器-fstack保护器,所有-fPIE -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS = 64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -L /家庭/ jcomeau / lib目录-Wl,-z,relro -Wl,-z,现在-pie -L /家庭/ jcomeau / lib目录conftest.cpp -lboost_thread -lminiupnpc -lminiupnpc -lminiupnpc -lminiupnpc>及5条
在/ usr /斌/劳工处:警告:libboost_system.so.1.54.0,由/home/jcomeau/lib/libboost_thread.so需要,没有发现(尝试使用-rpath或-rpath链接)
/home/jcomeau/lib/libboost_thread.so:未定义的引用`的boost ::系统:: system_category()
/home/jcomeau/lib/libboost_thread.so:未定义的引用`的boost ::系统:: generic_category()
collect2:错误:LD返回1退出状态
配置:11057:$? = 1

在这种情况下,我不得不改变我的./configure命令:

  ./配置CXXFLAGS = -  I $ HOME /包括LDFLAGS =L  -  $ HOME / lib目录 -  preFIX = $ HOME --with-助推LIBDIR = $ HOME / lib目录

  ./配置CXXFLAGS = -  I $ HOME /包括LDFLAGS =L  -  $ HOME / lib目录-Wl,-rpath链接,$ HOME / lib目录--with -boost-LIBDIR = $ HOME / lib目录 -  preFIX = $ HOME

按照这里的建议是:<一href=\"http://stackoverflow.com/questions/13507600/get-rid-of-gcc-usr-bin-ld-warning-lib-not-found\">Get摆脱&QUOT的; GCC - 在/ usr /斌/劳工处:警告lib中未发现与QUOT;

After I've installed boost for cufflinks, I ran ./configure. I am getting the following error:

checking for exit in -lboost_thread... no
checking for exit in -lboost_thread... (cached) no
checking for exit in -lboost_thread... (cached) no
error: Could not link against boost_thread ! 

解决方案

check your config.log, it will show you in more detail why it failed:

configure:11032: checking for exit in -lboost_thread
configure:11057: g++ -o conftest -I/home/jcomeau/include  -Wstack-protector -fstack-protector-all -fPIE  -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -L/home/jcomeau/lib  -Wl,-z,relro -Wl,-z,now -pie -L/home/jcomeau/lib conftest.cpp -lboost_thread  -lminiupnpc -lminiupnpc -lminiupnpc -lminiupnpc  >&5
/usr/bin/ld: warning: libboost_system.so.1.54.0, needed by /home/jcomeau/lib/libboost_thread.so, not found (try using -rpath or -rpath-link)
/home/jcomeau/lib/libboost_thread.so: undefined reference to `boost::system::system_category()'
/home/jcomeau/lib/libboost_thread.so: undefined reference to `boost::system::generic_category()'
collect2: error: ld returned 1 exit status
configure:11057: $? = 1

in this case I had to change my ./configure command from:

./configure CXXFLAGS="-I$HOME/include" LDFLAGS="-L$HOME/lib"  --prefix=$HOME --with-boost-libdir=$HOME/lib

to:

./configure CXXFLAGS="-I$HOME/include" LDFLAGS="-L$HOME/lib -Wl,-rpath-link,$HOME/lib" --with-boost-libdir=$HOME/lib --prefix=$HOME

in accordance with the advice here: Get rid of "gcc - /usr/bin/ld: warning lib not found"

这篇关于提高1.51:&QUOT;错误:无法链接对boost_thread&QUOT;!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆