c++ - Debian 测试中缺少 `/usr/lib/libboost_unit_test_framework-mt.so'

标签 c++ boost debian

我正在尝试构建几个月前上次使用的 CMake 项目,但我收到以下错误消息:

make[3]: *** No rule to make target `/usr/lib/libboost_unit_test_framework-mt.so', needed by `test/baumwelchtests'.  Stop.

确实,/usr/lib中不存在这个文件,只有libboost_unit_test_framework.so。普通版和-mt版有什么区别?我很确定 -mt 版本在最近的系统升级之一后被删除(我正在运行 Debian 测试,所以在最新的稳定版本之后有很多变化)。我怎样才能编译我的东西?

我的 CMakeLists.txt 看起来像这样:

# Include subdirectories for headers
find_package( Boost REQUIRED COMPONENTS unit_test_framework regex)

include_directories(${BaumWelch_SOURCE_DIR}/../../grzesLib/src
                    ${BaumWelch_SOURCE_DIR}/src 
                    ${Boost_INCLUDE_DIRS})

if(CMAKE_COMPILER_IS_GNUCXX)
    add_definitions(-g -std=c++11 -Wall -Werror -Wextra -pedantic -Wuninitialized)
endif()


# Create the unit tests executable
add_executable(
 baumwelchtests stockestimationtests.cpp forecasttest.cpp lagstest.cpp hiddenmarkovmodeltest.cpp stateindextest.cpp baumiterationtest.cpp baumwelchtest.cpp sampleparameters.cpp sdetest.cpp hmmgenerator.h
 # Key includes for setting up Boost.Test
 testrunner.cpp
 # Just for handy reference
 exampletests.cpp
)

# Link the libraries
target_link_libraries( baumwelchtests ${Boost_LIBRARIES} baumwelchlib grzeslib)

最佳答案

-mt 代表多线程。

您可以通过设置 set(Boost_USE_MULTITHREADED OFF)

强制 CMake 链接到常规的 boost 库

但很可能您只需要安装 libboost-test-dev

关于c++ - Debian 测试中缺少 `/usr/lib/libboost_unit_test_framework-mt.so',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18853777/

相关文章:

python - 如何通过Python脚本安装debian包?

c++ - 如何惯用地将 `` char *`` 转换为 `` double *``

c++ - 如何让协程始终在同一个线程中工作?

c++ - 使用链表会导致内存泄漏吗?

c++ - 媒体基础自定义混合器 MFT 出现错误 MF_E_CANNOT_CREATE_SINK

c++ - 永远运行 boost asio io_service

python - Upstart 和 Supervisord 有什么区别?

linux - (已回答) Bash SH 中的 find 命令未按预期工作

c++ - boost::posix_time:检索带夏令时的时间

c++ - Protocol Buffer 可以部分更新吗?