简体   繁体   English

链接…链接:致命错误LNK1181:无法打开输入文件'libgsl.a'

[英]Linking… LINK : fatal error LNK1181: cannot open input file 'libgsl.a'

I am using SIFT algorithm code by Rob Hess which uses OpenCV library, in Windows. 我正在使用Rob Hess的 SIFT算法代码,该代码在Windows中使用OpenCV库。 And I am having visual studio 2008 as the IDE. 我将Visual Studio 2008作为IDE。 When I run the program for image matching having Debug as the Solution Configuration in VS There is no problem, everything works fine. 当我运行具有Debug作为VS中的解决方案配置的图像匹配程序时,没有问题,一切正常。 But when i change the Solution Configuration to Release it gives a linking error. 但是,当我将解决方案配置更改为Release时,会给出链接错误。

The error is: 错误是:

Linking... LINK : fatal error LNK1181: cannot open input file 'libgsl.a' 链接...链接:致命错误LNK1181:无法打开输入文件'libgsl.a'

Can someone explain me the reason and tell me how to resolve this. 有人可以向我解释原因,并告诉我如何解决此问题。

Thank you 谢谢

Finally found it 终于找到了

Yes I was missing some libraries. 是的,我缺少一些图书馆。 libgsl.a comes in GnuWin32 gsl package. libgsl.a包含在GnuWin32 gsl软件包中。 This can be downloaded from sourceforge . 可以从sourceforge下载。 There is a directory named gsl in the list displayed. 显示的列表中有一个名为gsl的目录。 I downloaded gsl-1.8-lib.zip and extracted it to C:\\GnuWin32 in my computer. 我下载了gsl-1.8-lib.zip并将其解压缩到计算机中的C:\\ GnuWin32。

Next I included the library to Visual Studio. 接下来,我将库包含到Visual Studio中。 Here are the steps which I found from this webpage . 这是我从此网页中找到的步骤。 Although these are part of an unsuccessful try (according to the orginal post) this worked very well for me 尽管这些是尝试失败的一部分(根据原始帖子),但对我来说效果很好

  1. Within VisualStudio, go to File->New->Project, then "Visual C++ Projects," then "Win32," then "Win32 Console Application." 在VisualStudio中,依次转到“文件”->“新建”->“项目”,然后依次单击“ Visual C ++项目”,“ Win32”和“ Win32控制台应用程序”。 Enter a name and click "OK." 输入名称,然后单击“确定”。 On the next screen click "Finish." 在下一个屏幕上,单击“完成”。

  2. In the "Solution Explorer," right click on the name of your project and go to "Properties." 在“解决方案资源管理器”中,右键单击您的项目名称,然后转到“属性”。

  3. Under Configuration Properties->Linker->General->Additional Library Directories, type in "C:\\GnuWin32\\lib" 在“配置属性”->“链接器”->“常规”->“其他库目录”下,键入“ C:\\ GnuWin32 \\ lib”

  4. Under Configuration Properties->Linker->Input->Additional Dependencies, type in "libgslcblas.a libgsl.a" 在“配置属性”->“链接器”->“输入”->“其他依赖项”下,键入“ libgslcblas.a libgsl.a”

  5. Under Configuration Properties->C/C++->General->Additional Include Directories, type in "C:\\GnuWin32\\include" 在“配置属性”->“ C / C ++”->“常规”->“其他包含目录”下,键入“ C:\\ GnuWin32 \\ include”

  6. Under Configuration Properties->C/C++->Code Generation->Runtime Library,select "Multi-threaded DLL" 在“配置属性”->“ C / C ++”->“代码生成”->“运行时库”下,选择“多线程DLL”

It works fine now. 现在工作正常。 Thank you for every one who tried 谢谢每一个尝试过的人

也许您忘记了在Release配置中设置lib路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cython:链接:致命错误LNK1181:无法打开输入文件 - Cython: LINK : fatal error LNK1181: cannot open input file 链接:致命错误LNK1181:无法打开输入文件'libclamav.lib' - LINK : fatal error LNK1181: cannot open input file 'libclamav.lib' 错误 LNK1181:编译为 .LIB 时无法打开输入文件 - Error LNK1181: cannot open input file when compiling as .LIB 在Windows中使用C绑定构建Python包(VC90)会导致LNK1181致命错误 - Build Python package with C bindings in Windows (VC90) causes LNK1181 fatal error 链接:致命错误LNK1104:无法打开文件'C:\\ Users \\ hp \\ .pyxbld \\ lib.win32-2.7 \\ gensim \\ models \\ word2vec_inner.pyd' - LINK : fatal error LNK1104: cannot open file 'C:\Users\hp\.pyxbld\lib.win32-2.7\gensim\models\word2vec_inner.pyd' C动态链接到共享库抑制/处理“无法打开共享库文件”致命错误,并继续链接 - C dynamic linking to shared libs suppressing/handling “cannot open shared object file” fatal error, and continue linking ./a.out:加载共享库时出错:libgsl.so.23:无法打开共享对象文件:没有这样的文件或目录 - ./a.out: error while loading shared libraries: libgsl.so.23: cannot open shared object file: No such file or directory VisualStudio - 致命错误 LNK1168:无法打开 myfile.exe 进行写入 - VisualStudio - Fatal error LNK1168: cannot open myfile.exe for writing C MySQL错误“严重错误LNK1107:文件无效或损坏:无法在0x368处读取” - C MySQL error “fatal error LNK1107: invalid or corrupt file: cannot read at 0x368” 链接:致命错误 LNK1146:未使用选项“/MT”指定参数 - LINK : fatal error LNK1146: no argument specified with option '/MT'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM