Visual Studio 2013 LINK:致命错误LNK1181:无法打开输入文件

时间:2015-06-15 16:24:22

标签: c++ visual-studio opencv visual-c++ visual-studio-2013

我正在使用Visual Studio 2013.我正在尝试构建我教授给我的一些代码,并且我一直收到此错误:

  

LINK:致命错误LNK1181:无法打开输入文件   ' C:\用户\ manduchi \文件\ eyegaze \ EyeGazeDemo .. \库\的OpenCV \ lib中\ opencv_core249.lib'

但是,在我的电脑上,opencv_core249.lib位于其他地方。我已经尝试将链接器目录更新到我的计算机上的地址,但我继续收到错误。

这是我的尝试:

  • 在配置属性下 - > VC ++目录,我在包含目录和库目录中添加了包含.lib文件的文件夹的地址。
  • 链接器>一般,并在那里添加了一个额外的库目录。
  • 链接器>输入并添加" opencv_core249.lib"附加依赖

我是Visual Studio和C ++的新手,所以我可能做错了吗?

更多信息:

  • 我在Windows 7 Bootcamp上执行此操作
  • 代码在USB记忆棒上,因为我没有足够的空间 训练营分区。

任何帮助将不胜感激!感谢

更新

更新了错误消息

  

LINK:致命错误LNK1181:无法打开输入文件   ' opencv_calib3d300.lib'

我认为' opencv_calib3d300.lib'在链接器上 - >输入 - >继承值下的附加依赖项。

链接器命令行

/ OUT:"调试\ 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 \库\的OpenCV \ lib中\ opencv_core249d.lib" " E:\ eyegaze \ eyegaze \库\的OpenCV \ lib中\ opencv_imgproc249d.lib" " E:\ eyegaze \ eyegaze \库\的OpenCV \ lib中\ opencv_highgui249d.lib" " E:\ eyegaze \ eyegaze \库\的OpenCV \ lib中\ opencv_objdetect249d.lib" " E:\ eyegaze \ eyegaze \库\的OpenCV \ lib中\ opencv_ml249d.lib" " E:\ eyegaze \ eyegaze \库\ Intraface \ lib中\ IntraFaceDLL-x86d.lib" / DEBUG / MACHINE:X86 / SAFESEH / INCREMENTAL:NO /PGD:"debug\EyeGazeDemo.pgd" / SUBSYSTEM:WINDOWS / MANIFESTUAC:" level =' asInvoker' uiAccess ='假'" /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 \库\的OpenCV \ lib中" / LIBPATH:" E:\ eyegaze \ eyegaze \库\ Intraface \ lib中" / LIBPATH:" E:\ eyegaze \ eyegaze \ EyeGazeDemo" / LIBPATH:" C:\的OpenCV \建立\ 64 \ VC12 \ lib中" / TLBID:1

2 个答案:

答案 0 :(得分:3)

删除对库的所有引用。在某个地方,该项目指向您上面提供的路径,您需要删除它。

然后将库添加到可执行项目中。右键单击 - >添加 - >现有项目,将类型更改为所有文件,然后浏览到文件位置。

答案 1 :(得分:0)

您需要知道.lib文件的位置,然后您需要将其添加到项目配置中。它将非常类似于您添加DirectX库引用,BOOST等。我发现以下帖子显示how to add additional libraries

您还需要确保应用对所有版本进行更改,以便您获得发布,调试等功能。