Need help setting up with Netbeans

asked 2013-08-07 17:41:11 -0600

ppolis gravatar image

I am new to OpenCV and just began setting it up on my Windows XP 32-bit system. I downloaded Cygwin and set Netbeans up to use it. I then downloaded the latest version of OpenCV, 2.4.6, from the Sourceforge page and extracted the contents to C:\opencv246. I modified my "path" environment variable to include C:\opencv246\build\x86\vc10\bin. I created a new project in Netbeans and under "Include Directories" I added:

C:\opencv246\build\include\opencv C:\opencv246\build\include\opencv2 C:\opencv246\build\include C:\opencv246\include

I then went under "Additional Library Directories" and added:


And then went under "Additional Dependencies" and added:


Once this was done, I could write code without any errors, but when I tried to Build/Run it, the build failed, and Netbeans gave me this:

make[2]: *** No rule to make target 'opencv_core246d.lib', needed by 'dist/Debug/Cygwin_4.x-Windows/opencvtest.exe'. Stop 
make[1]: *** [.build-conf] Error 2 
make: *** [.build-impl] Error 2

and then eventually

BUILD FAILED (exit value 2, total time: 17s)

Can anyone identify what I've done wrong? I've viewed many tutorials on setup, but none have eliminated the issue. Any help would be terrific!

edit retag flag offensive close merge delete


With your include directories, you only need the include folders under your build folder, remove the others, since they create search patchs which are basically wrong. Maybe this creates problems for you?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-08 02:43:13 -0600 )edit

no idea about netbeans, but if you use mingw, you need all the mingw related stuff ( libs, dlls ) not vc10 or such

berak gravatar imageberak ( 2013-08-08 08:25:28 -0600 )edit

To add to that, vc10 is indeed the microsoft visual c compiler. So it could be that you will need to rebuilt openCV using NetBeans for it to actually work, since it will probably not use any microsoft compiler.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-08 08:35:50 -0600 )edit

I think you guys were right, after fiddling with Netbeans for a while longer, I switched to Microsoft Visual C++, followed the same setup steps, and the same code compiles and runs fine. Thanks anyways for the help!

ppolis gravatar imageppolis ( 2013-08-11 00:41:08 -0600 )edit