【发布时间】:2017-07-31 22:09:15
【问题描述】:
我已经阅读了多篇关于这个主题的帖子,但没有一篇能让我构建静态链接的 exe。
在我的 release 配置 (x64) 中,我有以下内容:
Configuration Properties -> General : Use of MFC - Use MFC in a Static Library
Configuration Properties -> C/C++ -> Code Generation : Runtime Library - Multi-threaded (/MT)
Configuration Properties -> Linker -> Command Line : Additional Options - I have all the required Windows libs "kernel32.lib", etc. (as use of MFC removed them from the "All Options" window above)
Configuration Properties -> Manifest Tool -> Input and Output : Embed Manifest - No
请注意,在 Configuration Properties -> Linker -> Input 中有 5 个 lib 文件,我在我的项目中使用,例如 glfw3.lib,我正在使用完全优化 (/Ox)。
在构建项目并自己运行 exe 后,我收到错误 “代码执行无法继续,因为找不到 glfw3.dll...” 等等。
使用dependencywalker我可以看到它需要与库关联的dll,当然找不到。
我是否误解了如何执行此操作,或者是否还有其他问题?
(我使用的是 Visual Studio 2017)
【问题讨论】:
标签: c++ visual-studio exe static-linking