error LNK1181 opencv_calib3d300d.lib

asked 2014-11-17 22:51:12 -0500

deltamaster gravatar image

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);
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)





C/C++>Additional Include Directories


VC++ Directories>Include Directories


VC++ Directories>Library Directories


VC++ Directories>Source Directories


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,


edit retag flag offensive close merge delete


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:

Doombot gravatar imageDoombot ( 2014-11-18 07:28:12 -0500 )edit

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

deltamaster gravatar imagedeltamaster ( 2014-11-18 19:03:30 -0500 )edit

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.

boaz001 gravatar imageboaz001 ( 2014-11-19 02:48:15 -0500 )edit

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.

ben.seep gravatar imageben.seep ( 2014-11-19 03:20:32 -0500 )edit

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 gravatar imagedeltamaster ( 2014-11-19 16:35:20 -0500 )edit

@deltamaster what is static library folder? where is it?

Aj-611 gravatar imageAj-611 ( 2016-01-31 21:02:09 -0500 )edit