use OpenCV with Clion IDE on Windows
<p>I'm actually looking for a way to create apps with OpenCV with Clion from JetBrains.</p>

<p>I've installed OpenCV with Choco, so I have all the stuff in C:\opencv</p>

<p>this is my projet with Clion</p>

<p>CMakeLists.txt:</p>

<pre><code>cmake_minimum_required(VERSION 3.3)
project(test)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories("C:\\opencv\\build\\include\\")

FIND_PACKAGE( OpenCV REQUIRED core highgui imgproc)
set(OpenCV_FOUND TRUE)

set(SOURCE_FILES main.cpp)
add_executable(prog ${SOURCE_FILES})
</code></pre>

<p>and the main.cpp:</p>

<pre><code>#include &lt;opencv2/opencv.hpp&gt;

int main() {

    cv::Mat img = cv::imread("./test.jpg", -1);
    cv::imshow("Mon image", img);
    cv::waitKey(0);
    return 0;
}
</code></pre>

<p>and the response to build is : </p>

<pre><code>undefined reference to `cv::imread(cv::String const&amp;, int)'
</code></pre>

<p>and undefined errors for all OpenCV functions</p>

<p>Do you know why it doesn't works?</p>