Ask Your Question
1

LINK : fatal error LNK1104: cannot open file 'opencv_core242d.lib'

asked 2012-11-17 18:32:37 -0600

Albtech gravatar image

II*I would be very thankful to anybody who helps me to resolve this problem. I have installed OpenCV according to installation guide and also when i type code i don't receive any error message from intellisense (that means that it was configured properly?!). But when it comes to building i always receive this error: LINK : fatal error LNK1104: cannot open file 'opencv_core242d.lib'.

I use Visual Studio 2012 (32 bit), Windows 8 (64 bit). *

edit retag flag offensive close merge delete

6 answers

Sort by ยป oldest newest most voted
6

answered 2012-11-18 05:47:41 -0600

Crash gravatar image

Yeah as I remember I had a similar troubles with that damn paths when installed OpenCv for the first time.

Try to write the correct paths into your property list. Don't forget, that prefix "d" is only for debug mode, so if you defined 'opencv_core242d.lib it would works only in Debug mode In my properties in VS 2012 I set

C/C++->General/Additional Include Directories:$(OPENCV_DIR)\include

Linker/Additional include Directories:$(OPENCV_DIR)\x86\vc10\lib

Linker/Input:

opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib opencv_objdetect243d.lib opencv_contrib243d.lib opencv_legacy243d.lib opencv_flann243d.lib

Here is a step-by-step video(maybe helps):http://www.youtube.com/watch?v=cgo0UitHfp8

edit flag offensive delete link more
1

answered 2012-11-19 11:35:39 -0600

Szczepan gravatar image

Hello. I got similar problem. I read book, tutorials etc and it still don't work. Now I have download latest version of OpenCV (2.4.3). Include to my project ( in include directories) "D:\opencv\build\include\opencv2", "D:\opencv\build\include","D:\opencv\build\include\opencv" and in library directories library path "D:\opencv\build\x86\vc10\lib". And in Linker/Input/Additional Dependencies i add opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib opencv_objdetect243d.lib opencv_contrib243d.lib opencv_legacy243d.lib opencv_flann243d.lib

Now i can compile it. But after i run i got error Canot run this application because can't find opencv_core243d.dll. Reinstall should help.

edit flag offensive delete link more

Comments

Thanks to the guys who tried to help. Even I do have the same error now. It seems that I am going to switch to Eclipse and Ubuntu. Maybe open source fits better with open source. Any suggestion?

Albtech gravatar imageAlbtech ( 2012-11-20 09:42:31 -0600 )edit
1

answered 2014-08-05 02:36:10 -0600

EliYAh gravatar image

Yeah "Crash"'s answer is right...But this error also occurs to me when I change my OpenCV version from 2.4.6 to 2.4.9 . I did'nt notice that my .lib files was change from opencv_core246d.lib to opencv_core249d.lib, and so on and so forth. You must also consider this thing.

edit flag offensive delete link more

Comments

I'm quite new to opencv,same question when from 2.4.3 upgrading to 2.4.9 , but i wanna ask you how can i solve this problem ,hope you can describe it more specifically thank you

sylph gravatar imagesylph ( 2014-10-30 22:11:20 -0600 )edit
0

answered 2012-11-20 17:08:48 -0600

Szczepan gravatar image

I think I fixed the problem(first example of code is working). I install opencv on ubuntu ( sudo apt-get install libopencv-dev or something like that in ubuntu terminal ). Then you must create new project in QT Creator (file>new project> qt console application). You will get 2 files main.cpp and your_project_name.proj. Type in 'your_project_name.proj' "INCLUDEPATH += I/usr/include/" "LIBS += -lopencv_core \ -lopencv_highgui \ -lopencv_imgproc \ -lopencv_features2d \ -lopencv_calib3d"

The code in main.cpp file is

#include< opencv2/core/core.hpp>

#include< opencv2/highgui/highgui.hpp>

int main()

{

cv::Mat koko = cv::imread("plik.jpg");
cv::namedWindow("Oko");
cv::imshow("oko",koko);
cv::waitKey(5000);

return 0;

}

And it's work fine. I don't check any other examples.

edit flag offensive delete link more
0

answered 2015-04-24 08:41:43 -0600

Hi everybody , I've the same problem but this time with world2411 , the msg error is : Error 1 error LNK1104: cannot open file 'opencv_world2411d.lib' , I've checked the configuration (libs....../ release and Debug) and all is good , but I've noticed that a file called "world" exist in the modules file but I can't find it here : C:\opencv\build\x86\vc12\lib , any suggestions plz :)

edit flag offensive delete link more
0

answered 2012-11-17 21:21:25 -0600

worst guy ever gravatar image

Intellisense will only predict compiler errors, this is a link stage error. You need to add the appropriate library directory to your project configuration. For a 32-bit project use opencv-2.4.x\build\x86\vc10\lib.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-11-17 18:32:37 -0600

Seen: 88,822 times

Last updated: Aug 05 '14