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

4

8

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?

Pedate answered 9/5, 2018 at 20:47 Comment(6)
That sounds like a Visual Studio IDE bug.Gimp
you should use ...build\x64\vc15\bin and ...opencv\build\x64\vc15\lib to begin with... Btw, I never experienced such a problem with VS2017Flux
I tried vc15, but the problem continues.Pedate
you only linked to opencv_world341d.lib. I hope you linked that in debug mode only, and that you're running in debug mode. Use opencv_world341.lib for release. If that's correct.. as last chance I'd upgrade visual studio to the latest versionFlux
I am using in Debug mode and x64, I have the latest version of VS.Pedate
Sorry then... good luck ;)Flux
W
3

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.

Weft answered 10/5, 2018 at 20:55 Comment(1)
The problem should be resolved in the next update of visual studio 2017. developercommunity.visualstudio.com/content/problem/258294/…Weft
P
3

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

Pedate answered 12/5, 2018 at 20:14 Comment(0)
P
2

It is still unfixed until 15.7.4 which was published today.

Pas answered 19/6, 2018 at 10:21 Comment(3)
Still unfixed in 15.7.5: #51372540Foulard
Still unfixed in 15.7.6Pas
Finally it has been fixed in 15.8.0Pas
S
1

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

Spacecraft answered 28/8, 2018 at 5:12 Comment(1)
Thanks alot, that fixed it, had same problem with GLFW/glfwCreateWindow.Dugong

© 2022 - 2024 — McMap. All rights reserved.