Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Freezes when I move mouse over Mat keyword (OpenCv 3.4.1)

Tags:

c++

opencv

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?

like image 910
adem sonmez Avatar asked May 09 '18 20:05

adem sonmez


4 Answers

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.

like image 182
Andrew T Avatar answered Nov 04 '22 09:11

Andrew T


It seems the problem is related with VS2017, I tried on VS2015 and did not get such an error.

like image 3
adem sonmez Avatar answered Nov 04 '22 08:11

adem sonmez


It is still unfixed until 15.7.4 which was published today.

like image 2
TY Sun Avatar answered Nov 04 '22 08:11

TY Sun


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 !!

like image 1
Nikhil Gupta Avatar answered Nov 04 '22 09:11

Nikhil Gupta