Visual Studio 2012 and OpenCV 2.4.9 [closed]

asked 2014-08-16 14:41:10 -0500

residentx gravatar image

updated 2014-08-16 18:08:56 -0500

I have some questions about installing all this stuff. I tried to do it but I have questions. I also have links to images to make things easier for comments.

I'm using Visual Studio 2012 Ultimate with OpenCV 2.4.9.

Step 1: I downloaded the .exe and ran it. I created a folder called OpenCV2.4. Question 1: Do I still need to use CMAKE here?

Step2: I tried to do this without CMAKE, and I was able to create a project but I have questions.

Question 2: Do I still need to add a system path?

Question 3: We should be using the build directory not the source, right?

Question 4: I'm creating the properties sheet but what has the Libraries been renamed to? Edit: I think I have to go in Build/x86/select(edit: changed to x86) and select the version of my visual studio and then the lib folder?

I'm working on this now...I may edit this later.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2014-08-19 03:01:56.372594


  1. most probably not. (though the supplied libs are kinda bare-metal. if you want cuda/ocl/tbb/whatever support, you will have to recompile using cmake

  2. yes, for sure.

  3. for the include path, yes.

berak gravatar imageberak ( 2014-08-16 14:54:53 -0500 )edit

I'm really close to getting this running. Let me list my steps so I can make sure everyone who wants to comment can get an idea of what I'm dealing with

  1. Downloaded the .exe.
  2. Installed it into a C:\OpenCV2.4 folder
  3. Created a C++ console empty App and configured the Win32 App Wizard.
  4. Opened the Property Manager and created 2 Property Sheets(*debug.props(dfiles) & *.release.props(regular)).
  5. Added the 19 libraries to each prop and configured the lib & Include settings.
  6. Created a source file and coded with sample code to test my app.
  7. Added an image to my solution and reference it in my code.
  8. Compiled the code.
  9. The Error message I received, opencv_core249.dll is missing.


residentx gravatar imageresidentx ( 2014-08-16 17:55:44 -0500 )edit

You need to modify the PATH environment variable to point to the directory that contains the DLLs. You are almost there.

unxnut gravatar imageunxnut ( 2014-08-16 20:02:44 -0500 )edit

This is so weird. The system can't find it but when I go to the bin folder I can see it.

So here's what I've done. I edited the environment/system variable and put this in.

OpenCV2.4_DIR (My OpenCV folder name is OpenCV2.4)


This should work, right? Maybe I need to reboot my machine.

residentx gravatar imageresidentx ( 2014-08-17 15:05:54 -0500 )edit

I have to edit the "Path" Variable. Thanks.

residentx gravatar imageresidentx ( 2014-08-17 15:16:51 -0500 )edit

Now I'm getting some kind of Access violation.

Here's the details from the output window:

'ConsoleApplication1.exe' (Win32): Loaded 'C:\Users\gcarlisle\Desktop\OpenCV\OpenCVProjects\ConsoleApplication1\Debug\ConsoleApplication1.exe'. Symbols loaded. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\OpenCV2.4\opencv\build\x86\vc11\bin\opencv_core249d.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:

residentx gravatar imageresidentx ( 2014-08-17 15:33:59 -0500 )edit

Here's the link to the image,

Here's the link to my text file with my full output,

residentx gravatar imageresidentx ( 2014-08-17 16:00:41 -0500 )edit

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, fi le C:\buildslave64\win64_amdocl\2_4_PackSlave-win32-vc11-shared\opencv\modules\h ighgui\src\window.cpp, line 261

residentx gravatar imageresidentx ( 2014-08-17 16:04:45 -0500 )edit

This is my final error message, I don't get breaks in my code now. It compiles but exits: The text file is here,

I think my issue is PDB files.

residentx gravatar imageresidentx ( 2014-08-17 16:23:26 -0500 )edit

Try recompiling the code (Rebuild Solution). Also make sure that the code is being compiled in 32-bit mode (x86) since that is what you have in your PATH variable.

unxnut gravatar imageunxnut ( 2014-08-17 20:03:08 -0500 )edit