View Single Post
Old 12-07-2008, 05:35 AM   #1
ShellShock
Guru
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 889
Karma: 1642544
Join Date: Sep 2008
Device: Sony PRS-505 & PRS-650, Kobo Glo & Aura HD
Problem & fix to Windows dev env setup

I'm currently following the instructions to set up the Windows dev environment here. With step 8, Install Qt, I was getting these errors:

Code:
../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:387: error: declaration of C function `long int InterlockedCompareExchange(long int*, long int, long int)' conflicts with
D:/CalibreDev/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1663: error: previous declaration `LONG InterlockedCompareExchange(volatile LONG*, LONG, LONG)' here
../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:388: error: declaration of C function `long int InterlockedIncrement(long int*)' conflicts with
D:/CalibreDev/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1676: error: previous declaration `LONG InterlockedIncrement(volatile LONG*)' here
../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:389: error: declaration of C function `long int InterlockedDecrement(long int*)' conflicts with
D:/CalibreDev/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1667: error: previous declaration `LONG InterlockedDecrement(volatile LONG*)' here
../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:390: error: declaration of C function `long int InterlockedExchange(long int*, long int)' conflicts with
D:/CalibreDev/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1668: error: previous declaration `LONG InterlockedExchange(volatile LONG*, LONG)' here
../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:391: error: declaration of C function `long int InterlockedExchangeAdd(long int*, long int)' conflicts with
D:/CalibreDev/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1672: error: previous declaration `LONG InterlockedExchangeAdd(volatile LONG*, LONG)' here
I've had a similar problem before in Windows development - this error occurs because Microsoft changed the declaration of these functions in their SDK some years ago. By the way, I'm using mingw 5.1.4 and Qt 4.4.3.

Anyway, I've got round this problem by changing MinGW\include\winbase.h, to remove volatile from the declaration of these functions:

InterlockedCompareExchange
InterlockedCompareExchangePointer
InterlockedDecrement
InterlockedExchange
InterlockedExchangePointer
InterlockedExchangeAdd
ShellShock is offline   Reply With Quote