LNK2019 Error When Building Version 3.1.0
First of all, I am a noob to both C++ and OpenCV, but I am not a noob to Visual Studio.
When trying to build a simple application (see below), I get LNK2019 errors beginning with complaints about the Mat class.
Mine is a simple console app. I installed OpenCVdefault v3.1.0 via NuGet. A dependency package called opencvdefault.redist was automatically installed in the process. I am using VS2017 with the Platform Toolset set to Visual Studio 2013 (v120). I tried setting the toolset to VS 2017 but got the same errors. In my project property pages, the Platform is set to x64.
I don't think it is material to the error condition, but prior to installing OpenCVdefault v3.1.0 via NuGet, I thought I might try compiling OpenCV. So I downloaded it, into a separate folder, of course, and set my environment variables with "setx -m OPENCV_DIR D:\OpenCV\Build\x64\vc12".
Please excuse the formatting below. I haven't gotten the hang of it yet.
#include "stdafx.h"
#include <opencv2/opencv.hpp>
using namespace cv;
int main()
{
// Read the image file
Mat image = imread("D:/My OpenCV Website/Eagle.jpg");
return 0;
}
sidenote: what's the silly#include "stdafx.h"
doing there ? do you know what you're doing at all ?if you're already using VS2017, could you try with the official current release instead ?
berak said, "do you know what you're doing at all ?"
Well, berak, you do know what "noob" means, right?
And, berak said, "if you're already using VS2017, could you try with the official current release instead ?" I hope to build a plug-in for Adobe Acrobat DC which requires C++ code compiled with VS2013. The official current release won't work for me in this case. OpenCV v3.1.0 is the most recent version that I could find that is compatible with V12. I have Visual Studio 2017. Hence, my Platform Toolset is set to Visual Studio 2013 (v120).
"setx -m OPENCV_DIR D:\OpenCV\Build\x64\vc12" --check, if that even exists." Yep. It does in deed exist.