tags:

views:

28

answers:

2

Hello,

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? Changing the MinGW version? or some other Environmental Setting?

it would be nice if someone has already sucessfully 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: *** [sub-src-make_default-ordered] Error 2  
A: 

It looks like you have duplicated includes for Qt. Exclude C:\mingw\lib\gcc\mingw32\4.5.0 from includepaths while compiling

Kamil Klimek
yes, you are probably right, but how do i exclude the "mingw include" path? its not that i don't know how to edit makefiles, but i have got the source package and configurator to generate makefiles and i expect it to work without patching makefiles. another issue is, i m kind of sure that if i will exclude the mingw path from makefile right now at later stage of compilation it will definetly complain about missing header which it expect to find from "mingw include"
Chirag
I'm not sure if Qt 4.1 is compatible with mingw4, you need mingw3 for such old version. I'm not sure but Qt got mingw4 compatiblity somwhere around Qt 4.5
Kamil Klimek
hello Kamil, thanks!, i think i should try with old version of mingw.
Chirag
I've found Qt compiled with mingw (also old packages): http://ftp.icm.edu.pl/packages/qt/source/
Kamil Klimek
A: 

thank u, but i have resolved it, our organization has licence for QT, i have compiled the commrcial version of source with vc++ compiler.

Chirag