• 7123阅读
  • 0回复

包含头文件windows.h时编译出错 [复制链接]

上一主题 下一主题
离线qiaoxing
 
只看楼主 正序阅读 楼主  发表于: 2010-08-05
我用的是Qt4.3.2版本的,一直都用的很好,这两天用到WINAPI,只要有头文件#include<windows.h>就会编译出错,请问是怎么回事?
D:\Code\Qt\q1>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `D:/Code/Qt/q1'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT
_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.3.2\include\QtCore" -I"c:\Qt\4.3.2\include\QtCore" -I"c:\Qt\4.
3.2\include\QtGui" -I"c:\Qt\4.3.2\include\QtGui" -I"c:\Qt\4.3.2\include" -I"." -I"c:\Qt\4.3.2\include\ActiveQt" -I"relea
se" -I"." -I"c:\Qt\4.3.2\mkspecs\default" -o release\main.o main.cpp
In file included from C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windows.h:50,
                 from main.cpp:4:
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1681: error: declaration of C function
`LONG InterlockedCompareExchange(volatile LONG*, LONG, LONG)' conflicts with
c:/Qt/4.3.2/include/QtCore/../../src/corelib/arch/qatomic_windows.h:189: error: previous declaration `long int Interlock
edCompareExchange(long int*, long int, long int)' here
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1685: error: declaration of C function
`LONG InterlockedDecrement(volatile LONG*)' conflicts with
c:/Qt/4.3.2/include/QtCore/../../src/corelib/arch/qatomic_windows.h:191: error: previous declaration `long int Interlock
edDecrement(long int*)' here
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1686: error: declaration of C function
`LONG InterlockedExchange(volatile LONG*, LONG)' conflicts with
c:/Qt/4.3.2/include/QtCore/../../src/corelib/arch/qatomic_windows.h:192: error: previous declaration `long int Interlock
edExchange(long int*, long int)' here
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1690: error: declaration of C function
`LONG InterlockedExchangeAdd(volatile LONG*, LONG)' conflicts with
c:/Qt/4.3.2/include/QtCore/../../src/corelib/arch/qatomic_windows.h:193: error: previous declaration `long int Interlock
edExchangeAdd(long int*, long int)' here
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1694: error: declaration of C function
`LONG InterlockedIncrement(volatile LONG*)' conflicts with
c:/Qt/4.3.2/include/QtCore/../../src/corelib/arch/qatomic_windows.h:190: error: previous declaration `long int Interlock
edIncrement(long int*)' here
mingw32-make[1]: *** [release\main.o] Error 1
mingw32-make[1]: Leaving directory `D:/Code/Qt/q1'
mingw32-make: *** [release] Error 2
快速回复
限100 字节
 
上一个 下一个