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

女生的网名这么多〃 提交于 2020-01-01 18:11:24

问题


I am using SIFT algorithm code by Rob Hess which uses OpenCV library, in Windows. And I am having visual studio 2008 as the IDE. When I run the program for image matching having Debug as the Solution Configuration in VS There is no problem, everything works fine. But when i change the Solution Configuration to Release it gives a linking error.

The error is:

Linking... LINK : fatal error LNK1181: cannot open input file 'libgsl.a'

Can someone explain me the reason and tell me how to resolve this.

Thank you


回答1:


Finally found it

Yes I was missing some libraries. libgsl.a comes in GnuWin32 gsl package. This can be downloaded from sourceforge. There is a directory named gsl in the list displayed. I downloaded gsl-1.8-lib.zip and extracted it to C:\GnuWin32 in my computer.

Next I included the library to 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." 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"

  4. Under Configuration Properties->Linker->Input->Additional Dependencies, type in "libgslcblas.a libgsl.a"

  5. Under Configuration Properties->C/C++->General->Additional Include Directories, type in "C:\GnuWin32\include"

  6. Under Configuration Properties->C/C++->Code Generation->Runtime Library,select "Multi-threaded DLL"

It works fine now. Thank you for every one who tried




回答2:


maybe you have forgotten to set up your lib paths in the Release configuration.



来源:https://stackoverflow.com/questions/3132680/linking-link-fatal-error-lnk1181-cannot-open-input-file-libgsl-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!