如何用MIDL对earth.idl文件生成头文件和库文件
penfe 2009-01-08 04:27:50 我想用MIDL对earth.idl文件生成需要头文件和库文件供C++ project使用。
1. 我把earth.idl include到项目中来,rebuild project,生成了earth_h.h,earth_i.c,earth_p.c和dlldata.c四个文件。
2. 然后exclude earth.idl文件,include earth_h.h,earth_i.c文件。
3. Rebuld project,结果出现.\earth_i.c : fatal error C1853: 'Release\GoogleEarthAPISample.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)
4. 在项目里关掉了Use Precompiled Header 后,编译通过。也可以用哪些接口了。
但是我看见Google上有人用MIDL生成的是头文件和库文件,请问有人知道怎么别让MIDL生成.c文件,而是生成库文件或者是.cpp文件?这样我就不用关掉Use Precompiled Header ,是吧?