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