Results 1 to 3 of 3

Thread: qextserialport libary compiling fails

  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default qextserialport libary compiling fails

    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?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qextserialport libary compiling fails

    How about trying with ftp://ftp.trolltech.com/misc/MinGW-3.4.2.exe? That version shouldn't conflict with Qt headers.
    J-P Nurmi

  3. #3
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Cool Re: qextserialport libary compiling fails

    Quote Originally Posted by sun View Post
    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!!!!

Similar Threads

  1. problem compiling QExtSerialPort
    By MarkoSan in forum Qt Programming
    Replies: 1
    Last Post: 8th December 2008, 13:03
  2. compiling hello world after fresh install fails
    By kvesi in forum Installation and Deployment
    Replies: 3
    Last Post: 19th September 2008, 13:55
  3. Compiling QSA 1.2.0 fails
    By detheang in forum Installation and Deployment
    Replies: 11
    Last Post: 4th February 2006, 20:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.