1、mkdir build
2、cmake-gui
操作系统写Linux
去掉
去掉WITH_CUDA
去掉WITH_GTK
去掉WITH_1394
去掉WITH_GSTREAMER
去掉WITH_LIBV4L(后边有v4l这个没用不要选)
去掉WITH_TIFF
去掉BUILD_OPENEXR
去掉WITH_OPENEXR
去掉BUILD_opencv_ocl
去掉WITH_OPENCL
3、修改CMakeCache.txt CMAKE_EXE_LINKER_FLAGS:STRING=-lpthread -lrt 增加 -lpthread -lrt
4、3rdparty/zlib、CMakeList。txt增加set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
参考1、https://www.oschina.net/question/2371345_2150582
2、http://blog.csdn.net/xy010902100449/article/details/45092757
时间: 2024-10-13 23:32:12