error LNK1181 opencv_calib3d300d.lib
Hi everybody,
I am working on a project and trying to get familiar with OpenCV. I have chosen to try and connect it with MS Visual Studio 2013. Here is the code I am trying to run:
"#include <opencv\cv.h> //ignore "
"#include <opencv\highgui.h> //ignore "
using namespace cv;
int main(){
IplImage* img = cvLoadImage("C:\\Users\\--\\Desktop\\ocv.png");
cvNamedWindow("Example1", CV_WINDOW_NORMAL);
cvShowImage("Example1", img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Example1");
return 0;
}
This is what I have done to connect to the OpenCV libraries:
In Properties
Linker>Additioinal Dependencies
"opencv_ts300d.lib";"opencv_calib3d300d.lib";"opencv_core300d.lib";"opencv_features2d300d.lib"; "opencv_flann300d.lib";"opencv_highgui300d.lib";"opencv_imgcodecs300d.lib";"opencv_imgproc300d.lib"; "opencv_ml300d.lib";"opencv_objdetect300d.lib";"opencv_photo300d.lib";"opencv_shape300d.lib"; "opencv_stitching300d.lib";"opencv_superres300d.lib";"opencv_ts300d.lib";"opencv_video300d.lib"; "opencv_videoio300d.lib";"opencv_videostab300d.lib";%(AdditionalDependencies)
Linker>Input
"C:\opencv\build\x86\vc12\lib";"C:\opencv\build\x86\vc12\bin"%(AdditionalLibraryDirectories)
Linker>General
"C:\opencv\build\x86\vc12\lib";"C:\opencv\build\x86\vc12\bin"%(AdditionalLibraryDirectories)
C/C++>Additional Include Directories
"C:\opencv\build\include";"C:\opencv\build\include\opencv";"C:\opencv\build\include\opencv2";%(AdditionalIncludeDirectories)
VC++ Directories>Include Directories
"C:\opencv\build\include";"C:\opencv\build\include\opencv";"C:\opencv\build\include\opencv2";$(IncludePath)
VC++ Directories>Library Directories
"C:\opencv\build\x86\vc12\bin";"C:\opencv\build\x86\vc12\lib";$(LibraryPath)
VC++ Directories>Source Directories
"C:\opencv\build\x86\vc12\bin";"C:\opencv\build\x86\vc12\lib";"C:\opencv\build\x86\vc12\staticlib"$(SourcePath)
I get a reoccurring error and my program will not compile.
Error 1 error LNK1181: cannot open input file 'opencv_calib3d300d.lib' C:\Users\Will\Documents\Visual Studio 2013\Projects\OPEN_CV_TEST\OPEN_CV_TEST\LINK OPEN_CV_TEST
I've tried manipulating everything. I've read all the other similar questions and noticed that other people are having this error. I've also read what Microsoft's website says on the issue. Any help would be appreciated very much.
Thank you,
deltamaster
Shouldn't you have:
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp>
I mean these are the includes I would use doing a C++ project.
Also, before someone else points it, you are writing code with the old "C" way of doing it. Now, C++ is privileged and here is a link to a simple tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/display_image/display_image.html#display-image
Thank you for your input. Adding the #includes does not fix the problem. I tried the code in the example-link and that gave me the same error! Thanks
Are you sure the library opencv_calib3d300d.lib is actually there in one of the linker include paths? Since it is not complaining about the first library (opencv_ts300d.lib) in the list, I'm just guessing. Besides that, the code your using is very old (and depricated); please stop using it and start using the C++ interface for new projects.
If built from source the lib files should be in C:\opencv\install\x86\vc12\lib or wherever install folder would be in your opencv build folder. A simple search for the .lib file in your windows explorer will also lead you there.
Thank you ben.seep that fixed my problem! This is what I did in case anybody has this issue:
In the staticlibrary folder are all the ...300d files.
I made a folder called "replace" in static library. I moved every ...300d file into the folder (just the ones that are added to additional dependencies). Moved the folder to desktop and copied the ...300d files to the library folder. Then it worked.
Note: If you don't move the files out of staticlibrary you will get hundreds of errors. An explanation of the reason behind this would be very helpful.
@deltamaster what is static library folder? where is it?