1
votes

I am using Visual Studio 2013. I'm trying to build some code given to me from my professor and I keep getting this error:

LINK : fatal error LNK1181: cannot open input file 'C:\Users\manduchi\Documents\eyegaze\EyeGazeDemo..\Libraries\OpenCV\lib\opencv_core249.lib'

However, on my computer opencv_core249.lib is located somewhere else. I've tried updating the linker directories to the address on my computer, but I continue getting the error.

Here was my attempt:

  • Under Configuration Properties-> VC++ Directories, I added the address of the folder enclosing the .lib file in Include Directories and in Library Directories.
  • Linker-> General and added an additional library directory there as well.
  • Linker-> Input and added "opencv_core249.lib" to additional dependencies

I'm new to Visual Studio and C++, so I might have done it incorrectly?

More info:

  • I'm doing this on my Windows 7 Bootcamp
  • the code is on a USB stick because I don't have enough space on my bootcamp partition.

Any help would be appreciated! Thanks

Update

Updated Error Message

LINK : fatal error LNK1181: cannot open input file 'opencv_calib3d300.lib'

I think 'opencv_calib3d300.lib' is on the Linker->input->Additional Dependencies under inherited values.

Linker Command Line

/OUT:"debug\EyeGazeDemo.exe" /MANIFEST /NXCOMPAT /PDB:"debug\EyeGazeDemo.pdb" /DYNAMICBASE "glu32.lib" "opengl32.lib" "gdi32.lib" "user32.lib" "opencv_ts300.lib" "opencv_ts300d.lib" "opencv_world300.lib" "opencv_world300d.lib" "E:\Qt\5.0.2\msvc2012_64\lib\qtmaind.lib" "E:\Qt\5.0.2\msvc2012_64\lib\Qt5Cored.lib" "E:\Qt\5.0.2\msvc2012_64\lib\Qt5Widgetsd.lib" "E:\Qt\5.0.2\msvc2012_64\lib\Qt5Guid.lib" "opencv_calib3d300.lib" "opencv_contrib300.lib" "opencv_core300.lib" "opencv_features2d300.lib" "opencv_flann300.lib" "opencv_gpu300.lib" "opencv_highgui300.lib" "opencv_imgproc300.lib" "opencv_legacy300.lib" "opencv_ml300d.lib" "opencv_nonfree300d.lib" "opencv_objdetect300d.lib" "opencv_ocl300d.lib" "opencv_photo300d.lib" "opencv_stitching300d.lib" "opencv_superres300d.lib" "opencv_video300d.lib" "opencv_videostab300d.lib" "kernel32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "OpenCVConfig.cmake" "OpenCVModules.cmake" "OpenCVModules-debug.cmake" "OpenCVModules-release.cmake" "E:\eyegaze\eyegaze\Libraries\OpenCV\lib\opencv_core249d.lib" "E:\eyegaze\eyegaze\Libraries\OpenCV\lib\opencv_imgproc249d.lib" "E:\eyegaze\eyegaze\Libraries\OpenCV\lib\opencv_highgui249d.lib" "E:\eyegaze\eyegaze\Libraries\OpenCV\lib\opencv_objdetect249d.lib" "E:\eyegaze\eyegaze\Libraries\OpenCV\lib\opencv_ml249d.lib" "E:\eyegaze\eyegaze\Libraries\Intraface\lib\IntraFaceDLL-x86d.lib" /DEBUG /MACHINE:X86 /SAFESEH /INCREMENTAL:NO /PGD:"debug\EyeGazeDemo.pgd" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Win32\Debug\EyeGazeDemo.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\opencv\build\x64\vc12\x64\vc11\lib" /LIBPATH:"E:\Qt\5.0.2\msvc2012_64\lib" /LIBPATH:"E:\eyegaze\eyegaze\Libraries\OpenCV\lib" /LIBPATH:"E:\eyegaze\eyegaze\Libraries\Intraface\lib" /LIBPATH:"E:\eyegaze\eyegaze\EyeGazeDemo" /LIBPATH:"C:\opencv\build\x64\vc12\lib" /TLBID:1

2
Please describe in detail the steps you took to change the linker settings.PaulMcKenzie
I right clicked on the project that was giving me the error. I then clicked on properties. Under Configuration Properties-> VC++ Directories, I added some directories in Include Directories and in Library Directories. I also went to Linker-> General and added an additional library directory there as well. And lastly I went to Linker-> Input and added "opencv_core249.lib" to additional dependencies.Joissa.R
looks like that wrong path is set somewhere directly in your "linker input" setting. maybe within a variable. can you post your whole "linker command line"?Micka
@Micka I've included the linker command line in my post, thanks!Joissa.R
your project seems to want opencv_core249.lib, while you got opencv_core300.lib just change the version number ?berak

2 Answers

3
votes

Remove all references to the library. Somewhere that project is pointing at the path you give above and you need to remove that.

Then add the library into the executable project. Right click->add->existing item, change the type to all files, then browse to the file location.

0
votes

You will need to know the location of the .lib file and then you will need to add it into your project configurations. It will be very similar to if you were adding a DirectX library reference, BOOST, etc. I found the following post which shows how to add additional libraries

You will also want to make sure you apply the changes to ALL builds so that you are covered for release, debug, etc.