Qt 4.1.4 Source Compile on Windows with MinGW
I am having an issue compiling the source of Qt framework version 4.1.4. (see the attached picture for exact compiler error text)
I am using this source of Qt (http://get.qt.nokia.com/qt/source/qt-win-opensource-src-4.1.4.zip)
And I'm using MinGW (latest from here http://sourceforge.net/projects/mingw/files/) which has GCC version 4.5.0.1
To me it seems that some function prototypes are diff in qatomic.h
and GCC include winbase.h
, it might be due to Qt 4.1.4 is bit old.
Can anyone tell me how to solve this issue? By changing the MinGW version? Or some other Environmental Setting?
It would be nice if someone has already successfully compiled Qt 4.1.4 with MinGW in past then please let me know which version of MinGW and GCC were used?
Compiler Output:
D:\Qt\qt-win-opensource-src-4.1.4>mingw32-make
cd src && mingw32-make -f Makefile
mingw32-make[1]: Entering directory `D:/Qt/qt-win-opensource-src-4.1.4/src'
cd winmain && mingw32-make -f Makefile
mingw32-make[2]: Entering directory `D:/Qt/qt-win-opensource-src-4.1.4/src/winma
in'
mingw32-make -f Makefile.Debug all
mingw32-make[3]: Entering directory `D:/Qt/qt-win-opensource-src-4.1.4/src/winma
in'
g++ -c -g -g -Wall -frtti -fexceptions -DQT_THREAD_SUPPORT -DUNICODE -DQT_LARGEF
ILE_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT
-I"D:/Qt/qt-win-opensource-src-4.1.4/include" -I"tmp" -I"D:/Qt/qt-win-opensourc
e-src-4.1.4/include/QtCore" -I"d:\Qt\qt-win-opensource-src-4.1.4\include\qtmain"
-I"tmp" -I"D:/Qt/qt-win-opensource-src-4.1.4/include/ActiveQt" -I"tmp\moc\debug
_shared" -I"." -I"..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qtmain_win.o
qtmain_win.cpp
In file included from D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/arch/qato
mic.h:1:0,
from D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/../../src
/corelib/thread/qatomic.h:31,
from D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/qatomic.h
:1,
from D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/../../src
/corelib/tools/qbytearray.h:28,
from D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/qbytearra
y.h:1,
from qtmain_win.cpp:25:
D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/arch/../../../src/corelib/arch/
windows/arch/qatomic.h:154:87: error: declaration of C function 'long int Interl
ockedCompareExchange(long int*, long int, long int)' conflicts with
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/winbase.h:1689:13: err
or: previous declaration 'LONG InterlockedCompareExchange(volatile LONG*, LONG,
LONG)' here
D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/arch/../../../src/corelib/arch/
windows/arch/qatomic.h:155:69: error: declaration of C function 'long int Interl
ockedIncrement(long int*)' conflicts with
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/winbase.h:1702:13: err
or: previous declaration 'LONG InterlockedIncrement(volatile LONG*)' here
D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/arch/../../../src/corelib/arch/
windows/arch/qatomic.h:156:69: error: declaration of C function 'long int Interl
ockedDecrement(long int*)' conflicts with
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/winbase.h:1693:13: err
or: previous declaration 'LONG InterlockedDecrement(volatile LONG*)' here
D:/Qt/qt-win-opensource-src-4.1.4/include/QtCore/arch/../../../src/corelib/arch/
windows/arch/qatomic.h:157:74: error: declaration of C function 'long int Interl
ockedExchange(long int*, long int)' conflicts with
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/winbase.h:1694:13: err
or: previous declaration 'LONG InterlockedExchange(volatile LONG*, LONG)' here
mingw32-make[3]: *** [tmp\obj\debug_shared\qtmain_win.o] Error 1
mingw32-make[3]: Leaving directory `D:/Qt/qt-win-opensource-src-4.1.4/src/winmai
n'
mingw32-make[2]: *** [debug-all] Error 2
mingw32-make[2]: Leaving directory `D:/Qt/qt-win-opensource-src-4.1.4/src/winmai
n'
mingw32-make[1]: *** [sub-winmain-make_default-ordered] Error 2
mingw32-make[1]: Leaving directory `D:/Qt/qt-win-opensource-src-4.1.4/src'
mingw32-make: 开发者_如何学JAVA*** [sub-src-make_default-ordered] Error 2
It looks like you have duplicated includes for Qt. Exclude C:\mingw\lib\gcc\mingw32\4.5.0 from includepaths while compiling
thank u, but i have resolved it, our organization has licence for QT, i have compiled the commrcial version of source with vc++ compiler.
精彩评论