我正在尝试构建几个月前上次使用的 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)
但很可能您只需要安装 libboost-test-dev
关于c++ - Debian 测试中缺少 `/usr/lib/libboost_unit_test_framework-mt.so',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18853777/