LNK4075:忽略“/EDITANDCONTINUE”由于“/OPT:ICF”规格

发布于 2024-08-08 08:53:53 字数 224 浏览 4 评论 0原文

我最近将多项目 Visual Studio 解决方案转换为对每个项目使用 .dll 而不是 .lib。但是,我现在收到每个项目的链接器警告,如示例中所述。 MSDN 对此并没有多大帮助。这是为什么?我该如何解决?

警告 2 警告 LNK4075:忽略 由于“/OPT:ICF”而导致“/EDITANDCONTINUE” 规范LudoCamera.obj

I recently converted a multi-project Visual Studio solution to use .dlls instead of .libs for each of the projects. However, I now get a linker warning for each project as stated in the example. MSDN didn't serve to be all that helpful with this. Why is this and how can I solve it?

Warning 2 warning LNK4075: ignoring
'/EDITANDCONTINUE' due to '/OPT:ICF'
specification LudoCamera.obj

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

抱着落日 2024-08-15 08:53:53

您可以获得“编辑并继续”支持或优化。通常,您将“编辑并继续”放在调试版本上,并将优化放在发布版本上。

编辑并继续允许您在调试时更改代码并保持程序运行。如果代码也必须优化,则不支持。

You can either have "Edit and continue" support or optimizations. Usually, you put "Edit and continue" on debug builds, and optimizations on release builds.

Edit and continue allows you to change code while you are debugging and just keep the program running. It's not supported if the code also has to be optimized.

你列表最软的妹 2024-08-15 08:53:53

我也有这个问题。我打开“项目属性”,然后单击“C/C++”选项卡中的“常规”。
有一个选项显示“调试信息格式”,我将其更改为程序数据库(/Zi),并且我不再收到警告。

I had this problem too. I opened the Project Properties, and then clicked General in the C/C++ tab.
There is an option that says 'Debug Information Format', which I changed to Program Database (/Zi), and I didn't get the warning anymore.

温柔一刀 2024-08-15 08:53:53

在将 VS2008 项目从 .lib 转换为 .dll 时,我也收到此警告,解决方法是将调试 Win32 配置上的链接器/优化设置从默认更改为:

References = Keep Unreferenced Data (/OPT:NOREF)

Enable COMDAT Folding = 请勿删除冗余 COMDAT (/OPT:NOICF)

I also got this warning when converting a VS2008 project from .lib to .dll and the workaround was to change the Linker/Optimization settings on the Debug Win32 configuration from Default to:

References = Keep Unreferenced Data (/OPT:NOREF)

Enable COMDAT Folding = Do Not Remove Redundant COMDATs (/OPT:NOICF)

橙幽之幻 2024-08-15 08:53:53

您应该将两个项目的“调试信息格式”设置为“程序数据库(/Zi)”。例如。如果警告是:

警告 LNK4075:由于“/OPT:ICF”规范 D:\mypath\project1\project1.obj project2 而忽略“/EDITANDCONTINUE”

然后在 project1 和项目的属性中。将它们设置为:

项目属性->配置属性->C/C++->常规->调试信息格式,设置为“程序数据库(/Zi)”;

you should set BOTH projects 'Debug Information Format' as 'Program Database(/Zi)'. Eg. If the warning is :

warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification D:\mypath\project1\project1.obj project2

Then in BOTH project1 and projects's properties. Set them as:

project properties->Configuration Properties->C/C++->General->Debug Information Format, set it as ‘Program Database(/Zi)’;

戏蝶舞 2024-08-15 08:53:53

我知道它是什么,它们不是发行版本。我认为链接器仍然认为它们是调试版本,当调试仍然打开时,它们仍然具有调试编辑和继续功能。

鲍勃.

I know what it is, they dll are not release versions. I think the linker still thinks they are debug builds, which still have the debug edit and continue functionality used when debugging still turned on.

Bob.

幻想少年梦 2024-08-15 08:53:53

我们必须在项目属性的“链接器”->“调试”窗格下将“生成调试信息”设置为“是(/DEBUG)”。不知道为什么一开始就没有为调试版本设置它,或者为什么它不是默认值,但就是这样。 (VS2010,如果相关的话。)

We had to set "Generate Debug Info" to "Yes (/DEBUG)" under the project properties' Linker->Debugging pane. Not sure how that wasn't set for a debug build in the first place, or why that wouldn't be the default, but there you go. (VS2010, in case that's relevant.)

音栖息无 2024-08-15 08:53:53

如果您不小心将调试目录添加到发布版本中,您也可能会收到此错误。检查链接器->常规->附加库目录。为我工作。

You can also get this error if you've accidentally added a debug directory into your release build. Check Linker->General->Additional Library Directories. Worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文