i'm trying to compile a simple opencv program. I've set the environment variables and also set the c++ additional include dir of the project as well as the additional linker directory and input dependencies (opencv_ts300d.lib and opencv_world300d.lib) but i keep getting linker's error for this code :
#include<iostream>
#include<opencv2\opencv.hpp>
#include<cstdio>
#include <string>
#include <opencv2\core\core.hpp>
#include <opencv2\imgcodecs.hpp>
#include <opencv2\highgui\highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
cv::Mat a;
return 0;
}
the errors are the following :
Translated:
Error 1 error LNK2019: unresolved external symbol "void __cdecl >cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: >__thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) C:\Users\Sergio\documents\visual studio 2013\Projects\opencvtest\opencvtest\Origine.obj opencvtest
Error 2 error LNK2019: unresolved external symbol "public: void >__thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced >in function "public: void __thiscall cv::Mat::release(void)" (?>release@Mat@cv@@QAEXXZ) C:\Users\Sergio\documents\visual studio 2013\Projects\opencvtest\opencvtest\Origine.obj opencvtest
Original:
Errore 1 error LNK2019: riferimento al simbolo esterno "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) non risolto nella funzione "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) C:\Users\Sergio\documents\visual studio 2013\Projects\opencvtest\opencvtest\Origine.obj opencvtest
Errore 2 error LNK2019: riferimento al simbolo esterno "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) non risolto nella funzione "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ) C:\Users\Sergio\documents\visual studio 2013\Projects\opencvtest\opencvtest\Origine.obj opencvtest
When this happened for me, I was linking to the x64 versions of of the OpenCV library but attempting to compile into a x86 (Win32) application. Just changing from a 32 bit to 64 bit application made mine work.