0

I'm trying to use openCV in microsoft visual studio project. My code is the following one:

cv::Mat IRGB; IRGB = cv::imread("C:\\Pierre\\Prog\\Toolboxes\\LibIm\\Tests_unitaires_cpp\\ressources\\mandrill.jpg");
if (IRGB.data){
    cv::Mat IGray;
    cv::cvtColor(IRGB, IGray, cv::COLOR_BGR2GRAY);
    cv::imshow("Image originale", IGray);
    cv::waitKey();
}
else{
    std::cout << "L'image n'a pas été chargée" << std::endl;
}

I have set up the include path: properties-> C/C++ -> $(OPENCV)\include

And also, the lib path:

properties -> Linker -> $(OPENCV)\x64\vc12\lib

properties ->Input -> Additional dependencies -> {opencv_calib3d249.lib opencv_contrib249.lib opencv_core249.lib, ... }

The compilation indicates 0 errors and 0 warnings but when I run the program imread doesn't work and the image is empty. Hoewever the followings messages are present in the console :

'Project1.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Cannot find or open the PDB file. 'Project1.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Cannot find or open the PDB file. 'Project1.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file. ...

When I set up the project in x86 and release mode everything work perfectly.

I have seen a lot of related topics but most often the author did a mistake linking debug, x64 version with release, x86 mode or vice versa.

If you have any ideas or solutions for my problem i would be grateful

Regards

  • I forgot to tell you, I have tried with a prebuild version of open CV 2.4.9 And I also tried with a self compiled version (using Cmake) – Pierre Guilbert Jul 28 '16 at 09:22
  • Are you using the correct binaries. I mean the ones from the vc12 folder of the download since Visual Studio 2013 is vc12. – drescherjm Jul 28 '16 at 09:31
  • ***Cannot find or open the PDB file.*** Means you don't have debugging symbols for these dlls. That has nothing to do with execution of your program. If while debugging in visual studio you want to debug inside these Microsoft dlls inspecting their internals you could fix this warning by enabling the symbol server. – drescherjm Jul 28 '16 at 09:37
  • Here is info how to add the symbols via the symbol server: http://stackoverflow.com/a/15938020/487892 – drescherjm Jul 28 '16 at 09:39
  • Hello drescherjm, thanks for your answers. I believe that i use the correct binaries because my lib path is $(OPENCV)\x64\vc12\lib. Replacing $(OPENCV) by its value the lib path is : C:\openCV2.4.9\opencv\build\x64\vc12\lib – Pierre Guilbert Jul 28 '16 at 09:48
  • and if i used my self building of openCV, the lib_path is : C:\openCV2.4.9\opencv\build\MyBuild\lib\Release – Pierre Guilbert Jul 28 '16 at 09:55
  • Perhaps you have the wrong `opencv` dlls in the path when executing the release build. These have to be the 64 bit Release mode dlls (Debug mode will cause UB) and must be created with Visual Studio 2013. – drescherjm Jul 28 '16 at 15:59

0 Answers0