CL plane guy
CL plane guy

Reputation: 35

How do I get Microsoft Visual Studio 2017 to link to the OpenCV 3.4 libraries?

I have downloaded:

Microsoft Visual Studio 2017 (14.0)

Microsoft Visual C++ 2017 x64 (14.12.25810)

And OpenCV 3.4

I try to get this stackoverflow program to run.

#include<iostream>
#include<opencv2/highgui/highgui.hpp>

usingnamespacecv;
usingnamespacestd;

intmain()
{
    Matim = imread("c:/full/path/to/lena.jpg");
    if(im.empty())
    {      
        cout<<"Cannotloadimage!"<< endl;
        return -1;
    }   
    imshow("Image", im);  
    waitKey(0);}

But I get an error:

cannot open source file 

"opencv2/highgui/highgui.hpp"

I have searched:

Opencv.org

Docs.opencv.org

Learnopencv.com

Stackoverflow.com

Gethub.com

Quora.com

AI shack

Google

None of these sites have given me an accurate solution to my first step modern problem. I have not found a way to #enclude the libraries. Does someone know the information that I am looking for?

Upvotes: 0

Views: 1007

Answers (2)

niranjan reddy
niranjan reddy

Reputation: 31

Try to include Opencv3.4\build\include in configuration properties in C/C++ and set lib file and .lib name in Linker paths.

Upvotes: 1

CL plane guy
CL plane guy

Reputation: 35

Best answer is at:

Installing OpenCV 2.4.3 in Visual C++ 2010 Express [closed]

Realize that it must be updated for Visual Studio 2017 and OpenCV 3.4

Upvotes: 0

Related Questions