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

时间:2013-09-17 15:22:31

标签: 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 Testing,因此在最新的稳定版本之后有很多变化)。我怎样才能把我的东西编译好?

我的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)

1 个答案:

答案 0 :(得分:2)

-mt代表mutlithreaded。

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

强制CMake链接到常规的boost库

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