开发者

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

开发者 https://www.devze.com 2023-01-04 19: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

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开发者_如何学Go '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. 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号