我可以要求VC ++链接器忽略未解决的外部? [英] Can I ask VC++ linker to ignore unresolved externals?

查看:222
本文介绍了我可以要求VC ++链接器忽略未解决的外部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用VC ++构建一个非常复杂的开源项目。该项目包括几十个库和一个可执行文件,取决于这些库。

I'm trying to build a very complex open-source project with VC++. The project consists of dozens of libraries and one executable depending on those libraries.

由于某些原因,VC ++链接器不想看到在其中一个库中实现的约40个函数并在每个报告未解决的外部参考,所以我不能链接。我不想浪费时间来解决问题 - 这些函数很可能从来不调用。

For some reasons VC++ linker doesn't want to see about 40 functions implemented in one of those libraries and reports "unresolved external reference" on each, so I can't link. I don't want to waste time resolving the problem - those functions are likely never called.

我想让链接器链接它看到和插入一些合理的错误处理(如报告错误和终止程序),而不是缺少函数。

I'd like to just ask the linker to link what it sees and insert some reasonable error handling (like reporting an error and terminating the program) instead of missing functions. How can I do that?

推荐答案

您可以使用 / FORCE:UNRESOLVED linker选项。

You can use the /FORCE:UNRESOLVED linker option.

其中的文档包含了低估的警告:

The documentation for that contains the rather understated warning:


使用此选项可能不会按预期运行

A file created with this option may not run as expected.

在pratice中,没有错误处理 - 。

In pratice, there'll be no error handling - just a crash.

这篇关于我可以要求VC ++链接器忽略未解决的外部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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