LIUNX 下未定义的引用 CMakeLists 正确写法

cmake_minimum_required(VERSION 3.5)
project(acm)

set(CMAKE_CXX_STANDARD 11)

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(acm main.cpp)
TARGET_LINK_LIBRARIES(acm
        ${OpenCV_LIBS}
        -lpthread
        )
find_package 

include_directories

target_link_libraries

注意最后的-lpthread,若无会出现未定义的引用

 

 

你可能感兴趣的:(Ubuntu,环境下配置,XX)