Dev C++编译包含windows.h头文件的程序时出错
我用Dev C++的32位图形界面工程建立程序,然后当我include<windows.h>头文件时,便开始出错`
如果把#include<windows.h>这一句去掉,又可以编译了
我是用Dev C++来写的,出错时的编译日志如下:
程序代码:
编译器: Default compiler Building Makefile: "F:\FILES\WorkStation\CSC\test\test\upload\Makefile.win" 执行 make... make.exe -f "F:\FILES\WorkStation\CSC\test\test\upload\Makefile.win" all gcc.exe -c main.c -o main.o -I"E:/Dev-Cpp/include" -ansi -traditional-cppIn file included from E:/Dev-Cpp/include/windows.h:48, from main.c:5: E:/Dev-Cpp/include/windef.h:263: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:263: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:264: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:264: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:265: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:265: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:266: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:266: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:267: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:267: error: syntax error before '{' tokenE:/Dev-Cpp/include/windef.h:268: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:268: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:269: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:269: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:270: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:270: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:271: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:271: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:272: error: syntax error at '##' tokenE:/Dev-Cpp/include/windef.h:272: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:273: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:273: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:276: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:276: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:278: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:278: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:279: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:279: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:281: error: syntax error before '*' token E:/Dev-Cpp/include/windef.h:282: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:282: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:283: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:283: error: syntax error before '{' tokenE:/Dev-Cpp/include/windef.h:284: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:284: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:285: error: syntax error before "HMODULE" E:/Dev-Cpp/include/windef.h:286: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:286: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:287: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:287: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:288: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:288: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:289: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:289: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:290: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:290: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:291: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:291: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:292: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:292: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:293: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:293: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:294: error: syntax error at '##' token E:/Dev-Cpp/include/windef.h:294: error: syntax error before '{' token E:/Dev-Cpp/include/windef.h:296: error: syntax error before "HCURSOR"In file included from E:/Dev-Cpp/include/windows.h:50, from main.c:5: E:/Dev-Cpp/include/winbase.h:1026: error: syntax error before "LPCTSTR" E:/Dev-Cpp/include/winbase.h:1027: error: syntax error before "LPCTSTR" E:/Dev-Cpp/include/winbase.h:1028: error: syntax error before "LPTSTR" E:/Dev-Cpp/include/winbase.h:1040: error: syntax error before "LPSTR" (中间一堆千字文,省略掉......具体请看附件) E:/Dev-Cpp/include/ole2.h:85: error: syntax error before "int" E:/Dev-Cpp/include/ole2.h:88: error: syntax error before "LPOLESTR" E:/Dev-Cpp/include/ole2.h:104: error: syntax error before "LPSTGMEDIUM" E:/Dev-Cpp/include/ole2.h:105: error: syntax error before "LPSTGMEDIUM" make.exe: *** [main.o] Error 1执行结束
是因为windows.h头文件的缘故吗?
哪位朋友能来帮个忙呢``?
[[it] 本帖最后由 svjh 于 2008-7-28 00:20 编辑 [/it]]
程序源代码及编译日志.rar
(10.43 KB)