【发布时间】:2016-06-07 22:12:26
【问题描述】:
我有一个来自我从事的项目的外部库,该库是针对 boost 1.55 编译的;我已经转移到另一个需要使用这个库的项目,但当前系统使用的是 boost 1.58。
当我链接到该库时,它抱怨它缺少对 boost 1.55 库的引用。我链接的库是使用以下 find_package 命令编译的:
find_package( Boost 1.55 COMPONENTS ... REQUIRED )
我知道 CMake 有一个 min 命令,但我不确定这是否允许我在当前运行 1.58 的机器上使用针对 boost 1.55 编译的库强>.
任何关于如何编译这个外部库以便它使用与 1.55 兼容的任何版本的 boost 的建议都将非常感激!
新程序的 find_package 命令尝试查找 boost):
find_package( Boost 1.55 COMPONENTS system filesystem chrono regex thread date_time REQUIRED )
新程序所在的系统升压为 1.58 而不是 1.55,因此它输出以下内容:
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- chrono
-- regex
-- thread
-- date_time
-- atomic
compile 在 1.58 上运行良好,只有当新程序链接到库(针对 1.55 编译)时,它才会抱怨无法找到 boost 1.55 库(见下文) .
链接输出:(新程序链接到库)
/usr/bin/ld: warning: libboost_system.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_filesystem.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_chrono.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_regex.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_date_time.so.1.55.0, needed by library.so, not found (try using -rpath or -rpath-link)
【问题讨论】:
-
您真的有问题吗?是这样发布详细信息。
-
我更新了这个问题,希望能更清楚。