找回密码
 注册
搜索
查看: 742|回复: 3

编译模拟器版本时,报bool类型重定义错误,请问如何解决?谢谢!

[复制链接]
发表于 2008-9-17 08:48:18 | 显示全部楼层 |阅读模式
错误提示如下:


D:\Microsoft Visual Studio\VC98\INCLUDE\windef.h(142) : error C2371: 'BOOL' : redefinition; different basic types
        ..\..\plutommi\mmi\Inc\MMIDataType.h(447) : see declaration of 'BOOL'
D:\Microsoft Visual Studio\VC98\INCLUDE\windef.h(159) : warning C4091: 'typedef ' : ignored on left of 'const int ' when no variable is declared
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(152) : warning C4091: 'typedef ' : ignored on left of 'const int ' when no variable is declared
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(156) : warning C4091: 'typedef ' : ignored on left of 'const int ' when no variable is declared
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(164) : warning C4091: 'typedef ' : ignored on left of 'const int ' when no variable is declared
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(167) : warning C4091: 'typedef ' : ignored on left of 'const int ' when no variable is declared
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(196) : error C2061: syntax error : identifier 'LPCTSTR'
D:\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(196) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1110) : error C2146: syntax error : missing ')' before identifier 'lpProcName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1110) : error C2081: 'LPCSTR' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1110) : error C2061: syntax error : identifier 'lpProcName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1110) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1111) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1162) : error C2146: syntax error : missing ')' before identifier 'pMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1162) : error C2061: syntax error : identifier 'pMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1162) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1163) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1251) : error C2146: syntax error : missing ')' before identifier 'pMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1251) : error C2061: syntax error : identifier 'pMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1251) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1252) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1302) : error C2146: syntax error : missing ')' before identifier 'lpBaseAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1302) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1302) : error C2061: syntax error : identifier 'lpBaseAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1302) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1302) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1304) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1339) : error C2146: syntax error : missing ')' before identifier 'lpAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1339) : error C2061: syntax error : identifier 'lpAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1339) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1339) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1342) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1381) : error C2146: syntax error : missing ')' before identifier 'lpAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1381) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1381) : error C2061: syntax error : identifier 'lpAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1381) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1381) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1384) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1437) : error C2146: syntax error : missing ')' before identifier 'lpMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1437) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1437) : error C2061: syntax error : identifier 'lpMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1437) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1438) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1446) : error C2146: syntax error : missing ')' before identifier 'lpMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1446) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1446) : error C2061: syntax error : identifier 'lpMem'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1446) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1447) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1532) : error C2146: syntax error : missing ')' before identifier 'lpApplicationName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1532) : error C2061: syntax error : identifier 'lpApplicationName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1532) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1532) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1534) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1539) : error C2146: syntax error : missing ')' before identifier 'lpApplicationName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1539) : error C2061: syntax error : identifier 'lpApplicationName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1539) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1539) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1541) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1552) : error C2146: syntax error : missing ')' before identifier 'lpszLongPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1552) : error C2061: syntax error : identifier 'lpszLongPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1552) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1552) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1555) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1560) : error C2146: syntax error : missing ')' before identifier 'lpszLongPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1560) : error C2061: syntax error : identifier 'lpszLongPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1560) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1560) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1563) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1574) : error C2146: syntax error : missing ')' before identifier 'lpszShortPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1574) : error C2061: syntax error : identifier 'lpszShortPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1574) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1574) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1577) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1582) : error C2146: syntax error : missing ')' before identifier 'lpszShortPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1582) : error C2061: syntax error : identifier 'lpszShortPath'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1582) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1582) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1585) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1738) : error C2143: syntax error : missing ')' before ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(1739) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2034) : error C2146: syntax error : missing ')' before identifier 'lpBaseAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2034) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2034) : error C2061: syntax error : identifier 'lpBaseAddress'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2034) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2034) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2038) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2065) : error C2143: syntax error : missing ')' before ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2066) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2247) : error C2143: syntax error : missing ')' before ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2248) : error C2040: 'BOOL' : 'void *' differs in levels of indirection from 'unsigned char '
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2248) : error C2146: syntax error : missing ';' before identifier 'bWaitAll'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2249) : error C2059: syntax error : 'type'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2250) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2415) : error C2146: syntax error : missing ')' before identifier 'lpBuffer'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2415) : error C2081: 'LPCVOID' : name in formal parameter list illegal
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2415) : error C2061: syntax error : identifier 'lpBuffer'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2415) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2415) : error C2059: syntax error : ','
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2419) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2499) : error C2143: syntax error : missing ')' before ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2500) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2501) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2502) : error C2059: syntax error : ')'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2550) : error C2146: syntax error : missing ')' before identifier 'lpModuleName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2550) : error C2061: syntax error : identifier 'lpModuleName'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2550) : error C2059: syntax error : ';'
D:\Microsoft Visual Studio\VC98\INCLUDE\winbase.h(2550) : fatal error C1003: error count exceeds 100; stopping compilation
发表于 2008-9-17 09:36:40 | 显示全部楼层
把定义bool的地方(非系统的,也就是非win的)用类似于win的宏排除掉。
点评回复

使用道具 举报

 楼主| 发表于 2008-9-23 14:40:14 | 显示全部楼层
不太懂,可以举个例子吗?谢谢!
点评回复

使用道具 举报

发表于 2008-9-24 16:05:52 | 显示全部楼层
这个问题的根音是“BOOL”的定义重复了。
在模拟器中会包含windows的标准头文件,其中定义了一个BOOL,但是你的程序中也定义了一个BOOL,所以就会出现这样的错误。
我猜在你以上的编译错误前还应该有个c文件编译错误,那个报错C文件里面很可能直接或间接定义了这个BOOL,比如有类似的语句:typedef unsighed char  BOOL 之类的语句,把此类语句用MMI_ON_WIN32之类的宏排除掉,如:
#ifndef MMI_ON_WIN32
typedef unsighed char  BOOL;
#endif
这类问题多数是因为第三方软件引入的,MTK发布的软件上的模拟器都是能够编译通过的。
希望能对你有帮助。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-6 13:20 , Processed in 0.045211 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表