如何在MS Visual Studio/Intel Fortran项目中链接.LIB? [英] How to link a .LIB in a MS Visual Studio / Intel Fortran project?

查看:324
本文介绍了如何在MS Visual Studio/Intel Fortran项目中链接.LIB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Visual Studio 2005与Intel Fortran 11.0集成在一起.我需要将项目链接到现有的库C:\mydir2\mydir1\mylib.lib.我该怎么办?

我将路径(C:\mydir2\mydir1)添加到Linker/General/Additional Library Directories,并将文件名及其路径(C:\mydir2\mydir1\mylib.lib)添加到Linker/Advanced/Import Library,但无济于事.我在某处丢失了一些东西,但不知道是什么.

有什么想法吗?谢谢.

解决方案

您并不是第一个想到导入库"的人.实际的目的是在链接DLL时更改链接程序创建的导入库的路径.正如汉斯所说,您可以使用其他依赖关系"(我承认这并不明显),甚至更简单,只需将.lib添加到您的项目中,就好像它是源文件一样.

还请注意,如果.lib是其他项目的输出,则可以将该项目添加到解决方案中,并使用项目依赖项"使它成为可执行文件的依赖项.然后,.lib将自动链接.

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.

解决方案

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.

这篇关于如何在MS Visual Studio/Intel Fortran项目中链接.LIB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆