fatal error C1001: An internal error has occurred in the compiler

VS2008驱动项目A,集成一个Wzarid生成的驱动LIB项目B,在编译64位驱动时,出现以下错误:

1>------ Build started: Project: xxxx, Configuration: Release x64 ------
1>Linking...
1>fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'f:\dd\vctools\compiler\utc\src\p2\p2symtab.c', line 1823)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++ 
1> Help menu, or open the Technical Support help file for more information
1>LINK : fatal error LNK1257: code generation failed
1>xxxx - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

首先确定是新引入的LIB引起的这个编译器错误,经过查看 C1001 错误的微软官方文档解释,如果错误路径是UTC目录下的,很可能是优化导致的此问题,只能挨个关闭LIB的优化选项来定位具体是哪个优化导致的;
在这里插入图片描述

最终定位到是GL选项导致此问题,关闭即可

如果是VS管理的项目,在C/C++ ===> Optimization ===》 Whole Program Opimization选项中设置为NO 即可关闭GL;
在这里插入图片描述

如果是DKKWarizd生成的项目,可以在source文件中加入一行,即可关闭GL
USER_C_FLAGS=/GL-

主要影响是关闭GL后,生成的LIB文件变小了

引用:

  • https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1001?view=msvc-170
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值