opencv 3.1.0 unresolved external [closed]
I just installed the opencv 3.1.0 version on my Win PC and tried to run it with Visual Studio 2010. When I compile my first bit of code I get 2 linker errors:
"unresolved externel void__cdecl cv::fastFree(void *)"
"public: void__thiscall cv::Mat::deallocate(void).
My main code:
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
#include <opencv\cv.h>
#include "opencv/highgui.h"
#include "opencv2/core/mat.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main (int argc, const char * argv[])
{
printf("Hello world, cv version: %s", CV_VERSION);
Mat img; // = imread("TD.img", CV_LOAD_IMAGE_UNCHANGED);
return 0;
}
The word "Mat" is not highlighted as it should be. Without the Mat line the program works fine.
Because the program compiles I think I got the include pathes right and the compiler doesnt complain about the *.libs, so they are found. I have linked the opencv_world310.lib.
What have I missed to get the things right? Thank you in advance.
please include
opencv2/opencv.hpp
, the oldcv.h
c--api headers won't help you.I did this but it wont help.
ofc, that won't help with the "unresolved external" , which is a linker problem.
are you sure, you link the correct opencv_world310.lib ? from the vc10 folder ? x86 vs.x64 ?
My lib path is: opencv/build/x64/vc12/lib. There is no x86 folder in my installation and no vc10 folder too. Just x64/vc12 and x64/vc14
"and no vc10 folder" - unfortunately, that means, that you will have to build the opencv libs for vs2010 from src, using cmake.
Oh, nooooo.... Or I update my VS to 2012.
yes, or that.
but really , in the long run you'll have to get used to building from src anyway.
Two things with Opencv 3.1.0, there are no 32bit prebuild libraries and libraries for 64bit are for VS15 and VS13. if you need other options than those, you need to build them yourselve. As it is a lil bit complicated, you might as well end up with Opencv 3.0.0