Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude OpenCV library dll's with CMake
    primarykey
    data
    text
    <p>I am trying to write a C++ application using the OpenCV libraries. As per the recommendation from the OpenCV maintainers, I am using CMake to generate the Makefile. My platform is Windows 7 (64 bit). My compiler is MinGW (so I am using the 'mingw32-make' tool to build the application).</p> <p>Right now I am trying to make sure my setup is correct so I can move forward with the code. I have verified that the OpenCV libraries have been built correctly. I then tried to verify that I could use CMake to include the OpenCV libraries in my build. I am using the following sample code from an OpenCV tutorial:</p> <p>DisplayImage.cpp</p> <pre><code>#include &lt;cv.h&gt; #include &lt;highgui.h&gt; using namespace cv; int main( int argc, char** argv ) { Mat image; image = imread( argv[1], 1 ); if (argc != 2 || !image.data) { printf( "No image data \n" ); return -1; } namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); imshow( "Display Image", image ); waitKey(0); return 0; } </code></pre> <p>CMakeLists.txt</p> <pre><code>cmake_minimum_required( VERSION 2.8 ) project( DisplayImage ) find_package( OpenCV REQUIRED ) add_executable( DisplayImage DisplayImage ) target_link_libraries( DisplayImage ${OpenCV_LIBS} ) </code></pre> <p>I used cmake-gui to generate the Makefile, then used mingw32-make to build the application. Everything works fine and the program compiles with no errors. However, when I try to run it, Windows stops and complains that it needs libopencv_core231.dll. I have checked and this dll is in my (OpenCV Build location)/bin directory. How can I get CMake/MinGW to include this when compiling?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload