首页 > 其他分享 >编CMAKE译BOOST 库问题

编CMAKE译BOOST 库问题

时间:2022-11-04 19:55:31浏览次数:69  
标签:CMAKE lib thread tuzi3 BOOST 问题 usr boost

1 CMAKE ..时出现的问题:

CMakeFiles/pcl_test.dir/tuzi3.cpp.o: In function `boost::this_thread::sleep(boost::posix_time::ptime const&)':
tuzi3.cpp:(.text._ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE[_ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE]+0x37): undefined reference to `boost::this_thread::hidden::sleep_until(timespec const&)'

2 解决:

  参考https://blog.csdn.net/moneymyone/article/details/122897274

  但是方法1不行,方法2可行,即为:需要在cmake之后,修改生成的项目.dir目录下link.txt文件,

在文件最后增加

-lboost_thread ,空格加。
。。。 /usr/lib/x86_64-linux-gnu/libboost_serialization.so
/usr/lib/x86_64-linux-gnu/libboost_regex.so -Wl,-rpath-link,/usr/local/lib -lboost_thread
再次make,即可成功。

 

标签:CMAKE,lib,thread,tuzi3,BOOST,问题,usr,boost
From: https://www.cnblogs.com/nanshan1/p/16858950.html

相关文章