我在vs 2008中遇到以下错误:
midl : error MIDL9008 : internal compiler problem - See documentation for suggestions on how to find a workaround.
midl: Assertion failed: ( rc < _MAX_DIR ) && ( rc != 0 ), file d:\longhorn\com\rpc\midl\front\filehndl.cxx, line 821
%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Include\Guiddef.h
标记的行上的文件<-----
中的以下代码引起的: #ifndef GUID_DEFINED
#define GUID_DEFINED
#if defined(__midl)
typedef struct {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
byte Data4[ 8 ];
} GUID; <------
#else
typedef struct _GUID {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[ 8 ];
} GUID;
#endif
#endif
重命名或删除“GUID”将解决内部编译器问题,但是当然会导致许多其他问题。使用的代码和midl.exe可执行文件(来自WinSDK v6.0)与另一台计算机上的相同,不会发生此错误。有谁比重新安装Windows更好的主意?
最佳答案
我的midl*
文件在安装了所有子组件的Windows 8.1 SDK
之后,或者在更新Visual Studio 2015时在某些时候“损坏”了,我想,因为我没有确切的时间记录它们何时被覆盖。
从那时起,我一直在编译项目前得到MIDL9008
,在此之前还不错。尝试构建某个项目时,Midlc.exe
甚至崩溃了。
解决方案是从以下位置替换midl*
文件:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
(because that's where midlc.exe and midl.exe were starting from, verified by using procmon)
midl*
文件的文件大小都不同,尽管报告的版本号相同!这明确表明更换它们可能会解决问题。(midl.exe, midlc.exe, midlrt.exe, midlrtmd.dll)
解决了此问题。很高兴我不必重新安装Windows即可解决此烦人且令人沮丧的问题!
https://stackoverflow.com/questions/8590202/
相关文章:
eclipse - 在Eclipse/STS中进行编译不会产生任何输出
visual-studio-2010 - XNA 4.0 Visual Studio 2010错误
gcc - 使用arm-linux-gcc编译STLPort时发生未知错误
jquery - MVC 4 : How to use the “partial validatio
msbuild - MSbuild 4.0无法编译.Net 3.5项目
objective-c - 初始化程序元素不是编译时常量错误
gcc - 将 gcc vector::iterator 传递给函数有什么问题?