I want to develop openCv project in Visual Studio 2017. I downloaded the opencv pre-build libraries and made necessary settings. That is:
1) I added System Path ...build\x64\vc14\bin
2) In Visual Studio from project properties I added Additional Include Directories ...opencv\build\include
under C/C++ -> General Settings
3) I added Additional Include Directories ...opencv\build\x64\vc14\lib
under Linker->General Settings
4) I added Additional Dependecies opencv_world341d.lib
under -> Linker->Input Settings
I wrote the following code and it is compiled without an error
// opencv.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <opencv2/opencv.hpp>
using namespace cv;
int main() {
Mat img;
return 0;
}
But the problem is when I move curser over Mat keyword after 2-3 seconds VS freezes and does not respond anyway. Do you have any idea why this happens?
You can disable the Auto Quick Info option by starting at the top menu and navigating to Tools, Options, Text Editor, C/C++, Advanced and under IntelliSense change the value for Auto Quick Info to False.
This will turn all of the Quick Info helpers off, but will at least keep the project from freezing.
It seems the problem is related with VS2017, I tried on VS2015 and did not get such an error.
It is still unfixed until 15.7.4 which was published today.
This error is caused due to a long comment about Mat. Look for mat.hpp files in your include directory of opencv (use search to find) >> go to Mat function definition >> remove the multiline comment before Mat definition.
There are two mat.hpp files in the include directory. Follow the steps in both.
Save the files. Restart Visual Studio and enjoy !!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With