visual-studio 在 Visual Studio C++ 项目中,在哪里输入 DLL 依赖项?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2967667/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where do I input DLL dependencies in Visual Studio C++ project?
提问by Dave Mateer
I am converting some Qt project files (.pro) that run on Linux and Mac into Visual Studio project files (.vcproj) The Qt Visual Studio add-in converted everything fine except the DLL dependencies. Where do I put these in Visual Studio 2008?
我正在将在 Linux 和 Mac 上运行的一些 Qt 项目文件 (.pro) 转换为 Visual Studio 项目文件 (.vcproj) Qt Visual Studio 加载项转换一切正常,除了 DLL 依赖项。我将这些放在 Visual Studio 2008 中的什么位置?
If I put the DLLs in Configuration Properties > Linker > Input > Additional Dependencies, I get:
如果我将 DLL 放在“配置属性”>“链接器”>“输入”>“附加依赖项”中,我会得到:
fatal error LNK1107: invalid or corrupt file: cannot read at 0xABC
Where do dynamically-linked dependencies go?
动态链接的依赖去哪里了?
回答by Ben Burnett
Project Properties -> Linker -> Input -> Additional Dependencies
项目属性 -> 链接器 -> 输入 -> 附加依赖项
In that field put xxxx.lib for whatever library you need.
在该字段中,将 xxxx.lib 放在您需要的任何库中。
回答by Troubadour
You might want to check what's the differences between .dll , .lib, .h files ?.
您可能想检查.dll、.lib、.h 文件之间的区别是什么?.
You need to specify the corresponding .lib file at link time. not the dll.
您需要在链接时指定相应的 .lib 文件。不是 dll。

