How to link a .LIB in a MS Visual Studio / Intel Fortran project?

匆匆过客 提交于 2019-12-11 13:45:29

问题


I have Visual Studio 2005 integrated with Intel Fortran 11.0. I need to link my project to an existing library C:\mydir2\mydir1\mylib.lib. How do I do that?

I added the path (C:\mydir2\mydir1) to Linker/General/Additional Library Directories and the file name with its path (C:\mydir2\mydir1\mylib.lib) to Linker/Advanced/Import Library, to no avail. I'm missing something somewhere, but don't know what.

Any ideas? Thanks.


回答1:


You're not the first to think that "Import Library" is the spot for this. What that's actually for is to change the path to the import library created by the linker when you link a DLL. You can, as Hans says, use Additional Dependencies (not obvious, I admit), or even easier, just add the .lib to your project as if it were a source file.

Note also that if the .lib is an output of some other project, you can add that project to the solution and use Project Dependencies to make it a dependent of your executable. Then the .lib will be linked in automatically.



来源:https://stackoverflow.com/questions/31975440/how-to-link-a-lib-in-a-ms-visual-studio-intel-fortran-project

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