我正在尝试将Boost的Math库包含到我的CMake C ++项目中,但当连接库时编译器返回错误。
这是我的CMakeLists.txt文件。
这是我的CMakeLists.txt文件。
cmake_minimum_required(VERSION 3.24)
project(ImageProcessor)
set(CMAKE_CXX_STANDARD 17)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(ImageProcessor main.cpp)
target_link_libraries(ImageProcessor ${OpenCV_LIBS} Boost::boost)
编辑:
这是我在构建时遇到的错误:
/usr/bin/ld: CMakeFiles/ImageProcessor.dir/main.cpp.o: undefined reference to symbol '_ZN3tbb6detail2r114execution_slotEPKNS0_2d114execution_dataE'
/usr/bin/ld: /usr/lib/libtbb.so.12: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
math::statistics::simple_ordinary_least_squares_with_R_squared
函数,我已经更新了我的问题,以包括编译错误。 - Robomaze