error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI' 编译问题
2016-08-29 19:03
627 查看
遇到的问题:
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2043: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2044: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2045: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2046: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2047: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
c语言调用windows API, 编译的时候出现的问题。
原因:
源代码中包含头文件:
#include <winbase.h>
#include <windows.h>
顺序是这样写的,问题出在windows.h 头文件本身包含 winbase.h,这是一个头文件重复包含的问题。(这个问题切记)
提醒:
还有的编程中出现头文件相互包含问题,会出现很奇怪的编译错误,一定要注意。
出现奇怪编译问题,头文件问题是一个考虑的地方。
解决:
只需要包含 #include <windows.h> 头文件。
网上搜索到的一个结果:
参考:http://blog.chinaunix.net/uid-20937170-id-3327109.html
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2043: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2044: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2045: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2046: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
../lib/gcc/mingw32/4.3.3/../../../../include/WinBase.h:2047: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
c语言调用windows API, 编译的时候出现的问题。
原因:
源代码中包含头文件:
#include <winbase.h>
#include <windows.h>
顺序是这样写的,问题出在windows.h 头文件本身包含 winbase.h,这是一个头文件重复包含的问题。(这个问题切记)
提醒:
还有的编程中出现头文件相互包含问题,会出现很奇怪的编译错误,一定要注意。
出现奇怪编译问题,头文件问题是一个考虑的地方。
解决:
只需要包含 #include <windows.h> 头文件。
网上搜索到的一个结果:
参考:http://blog.chinaunix.net/uid-20937170-id-3327109.html
相关文章推荐
- 编译错误:error: expected '=', ',', ';', 'asm' or '__attribute__' before...
- Android error: expected '=', ',', ';', 'asm' or '_attribute_' before '==' token
- error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
- error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
- error: expected '=', ',', ';', 'asm' or '__attribute__' before 'glbvar'
- Objective-C编译错误:expected '=', ',', ';', 'asm' or '__attribute__' before ***
- 报错 error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
- logic.c:1:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
- error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ’***'
- expected '=', ',', ';', 'asm' or '__attribute__' before(使用uint16_t uint32_t出现的问题)
- gcc编译,出现错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ........
- NDK编译错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
- C -- error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- logic.c:1:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
- “expected '=', ',', ';', 'asm' or '__attribute__' before 'void'”
- expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
- clientglobalextern.h:31: 错误:为形参 ‘SVS_CLI_CONTEXT’ 指定了存储类 ksvs_client.c:40: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
- 【编程经验】错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
- 提示错误“expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token“
- expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token 或者 before ‘{’ token