c++ - 未解析的外部符号显示为错误 while/force :unresolved is used

标签 c++ visual-studio dll linker unresolved-external

有没有办法改变 LNK2001 日志的严重性(比如从错误到警告),或者甚至在链接时使用/force:unresolved 标志时避免此日志?

基本上,我想强制生成一个 dll(带有 undefined symbol ,比如说“X”)并在可执行链接时延迟符号解析(可执行文件与“强制”dll 和另一个链接其中包含“X”符号)。

最佳答案

From documentation of /FORCE :

/FORCE:UNRESOLVED is ignored if the entry point symbol is unresolved

因此请检查您的 DLL 是否有 entry point .

有一个未记录的选项可以关闭某些链接器 warnings ,但不是错误。

关于c++ - 未解析的外部符号显示为错误 while/force :unresolved is used,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24547536/

相关文章:

C++ 字符串文字和常量

visual-studio - Visual Studio,仅折叠/扩展区域快捷方式

c++ - Qt 5.2 DLL 返回与调用 DLL 的应用程序不同的结果

c# - 如何对c#代码进行加密,使其不易被反编译和读取

C++ 前向声明 using 指令

c++ - 方法参数的内存错误(访问冲突)

python - Kivy 应用程序崩溃 : "Not Responding"

c# - 在 Qt 项目中使用 PICkitS.dll

c++ - fatal error : SFML/Graphics. hpp:不存在这样的文件或目录

visual-studio - 从 Qt SDK 包管理器为 Visual Studio 安装 Qt 插件