PDA

View Full Version : qextserialport libary compiling fails



sun
6th March 2009, 12:13
Hi,

I have installed Qt 4.4.1 OS and MinGW 5.1.3 and am trying to compile qextserialport 1.1 and 1.2alpha.
I unzip the downloaded files and go into the folder. (Using Windows XP - cmd)
qmake runs smoothly but make produces an error:


\sun\Qt\4.4.1\include\ActiveQt" -I"build\moc" -I"." -I"..\Qt\4.4.1\mkspecs\win
32-g++" -o build\obj\qextserialport.o qextserialport.cpp
In file included from C:/sun/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../in
clude/windows.h:50,
from win_qextserialport.h:11,
from qextserialport.h:12,
from qextserialport.cpp:21:
C:/sun/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1663:
error: declaration of C function `LONG InterlockedCompareExchange(volatile LONG*
, LONG, LONG)' conflicts with
../Qt/4.4.1/include/QtCore/../../src/corelib/arch/qatomic_windows.h:393: error:
previous declaration `long int InterlockedCompareExchange(long int*, long int, l
ong int)'

I tried out compiling qwt wich works fine. Andy idea where to start look for the problem?

jpn
6th March 2009, 13:54
How about trying with ftp://ftp.trolltech.com/misc/MinGW-3.4.2.exe? That version shouldn't conflict with Qt headers.

rocenting
6th March 2009, 15:39
Hi,

I have installed Qt 4.4.1 OS and MinGW 5.1.3 and am trying to compile qextserialport 1.1 and 1.2alpha.
I unzip the downloaded files and go into the folder. (Using Windows XP - cmd)
qmake runs smoothly but make produces an error:


I tried out compiling qwt wich works fine. Andy idea where to start look for the problem?


when I compile QT static library I have found the problem.

I added a macro to fix this compile bug.

C:\Qt\4.4.3\src\corelib\arch\qatomic_windows.h 387 lines

// add macro by rocenting to fix compile bug
#ifndef __INTERLOCKED_DECLARED // add by rocenting.
#define __INTERLOCKED_DECLARED // add by rocenting.

extern "C" {
__declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);
__declspec(dllimport) long __stdcall InterlockedIncrement(long *);
__declspec(dllimport) long __stdcall InterlockedDecrement(long *);
__declspec(dllimport) long __stdcall InterlockedExchange(long *, long);
__declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);
}
#endif // add by rocenting.

I hope I can help you. Good luck to you!!!!