Linking to OpenCV - undefined reference to `cv::imread

已完成

Hi, I'm trying to link OpenCV to CLion. But I'm having problem even with a very simple app.

 

I prepared OpenCV binaries with these steps.

1. Extract OpenCV files (from official website)

2. Generate a build folder with CMake

3. In the directory generated by CMake, execute "mingw32-make" command

4. Add "OPENCV_DIR" to system variables. ("C:\OpenCV\mingw-build" in my case)

5. Add "%OPENCV_DIR%\bin" to system path

 

CPP Code:



My CMakeLists.txt





And when I try to build, I'm getting these messages:

 

0
Avatar
Permanently deleted user

I finally solved my problem. I'm using MinGW 5.3 on my IDE. But CMake is using MinGW 4.9 as default, if you select "Use default native compilers". So you should select "specify native compilers" and give the path of MinGW that using with your IDE. And then you should run "mingw32-make.exe" from the same MinGW again.

0

请先登录再写评论。