今天请教了一下董师兄,学会了编译。
第一步:创建cpp文件 test.cpp。
第二步:编写CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project( TEST )
find_package( OpenCV REQUIRED )
add_executable( test test.cpp )
target_link_libraries( test ${OpenCV_LIBS})
第三步:cmake
第四步:cmake .(空格+后面有个点)
第五步:make
第六步: 运行./test