linux下配置opencv开发环境 opencv + ubuntu + clion

最近在把opencv代码移植到linux平台下面运行,在linux下配置opencv花了一天时间,包括编译opencv,在clion IDE开发工具中配置opencv

1.编译linux过程网上很多,如果用命令行方式来make,会很报很多找不到include_next 和函数找不到等错误,建议在Ubuntu14.0上用cmake-gui来编译opencv库

2.主要说下第2点,如果开发环境是用的clion怎么配置opencv

需要修改两个地方,一个clion工程的cmakelist.txt  ,下面这个配置看了应该一幕了然


cmake_minimum_required(VERSION 3.8)
project(untitled) //项目名称

set(CMAKE_CXX_STANDARD 11)//c++版本

include_directories(/home/nz/openCV/lib/include)
include_directories(/home/nz/openCV/lib/opencv)
include_directories(/home/nz/openCV/lib/opencv2)//opencv引用头文件

set(SOURCE_FILES main.cpp)
set (OpenCV_DIR /home/nz/openCV/out)//opnecv头文件库目录

find_package(OpenCV REQUIRED)
add_executable(untitled ${SOURCE_FILES})

target_link_libraries(untitled ${OpenCV_LIBS})

如果还报错在cmakeopencv.txt 加set found 1


你可能感兴趣的:(linux下配置opencv开发环境 opencv + ubuntu + clion)