Results 1 to 10 of 10

Thread: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

  1. #1
    Join Date
    May 2008
    Posts
    7
    Thanked 5 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    1.Download GCC 4.3.2: http://www.tdragon.net/recentgcc/ click "TDM/MinGW Installer 1.808.3" to download and install;

    2.Download Qt 4.4.3: ftp://ftp.trolltech.com/qt/source/qt....4.3-mingw.exe and install it. You will get a warning, just click OK to ignore;

    3.In your System Environment's PATH, add YourMinGWDir\bin and YourQtDir\4.4.3\bin;

    4.There are some bugs in Qt 4.4.3. Please fix them:

    (1) Qt\4.4.3\src\corelib\arch\qatomic_windows.h: check line 386-392, they should be:
    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);
    }
    Please modify them like below:
    extern “C” {
    __declspec(dllimport) long __stdcall InterlockedCompareExchange(volatile long *, long, long);
    __declspec(dllimport) long __stdcall InterlockedIncrement(volatile long *);
    __declspec(dllimport) long __stdcall InterlockedDecrement(volatile long *);
    __declspec(dllimport) long __stdcall InterlockedExchange(volatile long *, long);
    __declspec(dllimport) long __stdcall InterlockedExchangeAdd(volatile long *, long);
    }

    (2) Qt\4.4.3\src\corelib\io\qfsfileengine_win.cpp: check line 67-68, they should be:
    #define SECURITY_WIN32
    #include <security.h>
    Add a line between them #include <subauth.h>, like these lines below:
    #define SECURITY_WIN32
    #include <subauth.h>
    #include <security.h>

    (3) Qt\4.4.3\src\gui\inputmethod\qwininputcontext_win. cpp: check line 500, it should be:
    bool QWinInputContext::endComposition()
    Please add a line above it: extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); ,like these lines blow:
    extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
    bool QWinInputContext::endComposition()

    5.OK. It's time to compile. Click "Start"->"Qt by Nokia v4.4.3 (OpenSource)"->"Qt 4.4.3 Command Prompt", then enter "configure -debug-and-release -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg" and enter to configure. After several minutes, configure will done. And enter "mingw32-make" and enter to compile. It may take about 3 hours to make. It should take 4G harddisk place.

  2. The following 5 users say thank you to shiyutang for this useful post:

    ComaWhite (14th March 2009), pastor (2nd November 2008), piotr.dobrogost (15th July 2009), shirazk (27th October 2008), yuniarto.rahardjo (1st December 2008)

  3. #2
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    Thank you, Shiyutang. This is a beeg help...the corrections particularly so. Only, it has not been 3 hours, but has now been compiling for more than twelve hours straight with no end in sight (perhaps I don't have as powerful a computer as you).

    Thanks again.

    Shirazk.

  4. #3
    Join Date
    May 2008
    Posts
    7
    Thanked 5 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    My computer is a ThinkPad T61, with a CPU Inter Core 2 Duo T7500, and 2GB memory.

  5. #4
    Join Date
    Jul 2008
    Location
    St. Louis, MO
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    I just wanted to say thanks for a great post. I was able to make the necessary modifications and build qt quite easily. But as another person mentioned is does take some time, so I basically started the build before going to bed, and it was finished in the morning. Anyway, thanks again.

  6. #5
    Join Date
    Jul 2008
    Location
    St. Louis, MO
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    A couple of relatively minor notes to keep in mind, especially for us newbies:

    The primary purpose of this installation process is to update MinGW from gcc version 3.4.5 to gcc 4.3.2, a much more recent compiler but less tested than the "official" 3.4.5 release.

    Purely for convenience, to temporarily keep the 3.4.5 libraries separate from the 4.3.2 libraries that I am now creating, I moved the source for Qt to a different directory than where I originally installed Qt when I used the installation program noted in this post.

    If you do put the source in another location as I did, it will impact a number of items:
    a) the environment variables used by the configure program have to be changed. These are "Lib" and "Include", and they were defined by the setup program to point to the original location for the source.
    b) using the command prompt in the menus for the original Qt installation (menu "All Programs", "Qt by Nokia", "Qt Command Prompt") executes the qtvars.bat program that was generated by the installation program. Qtvars will define variables that point to the original folders for Qt, not the modified location I used afterwards.

    I chose a quick and dirty way to address this, although I'm sure there are many other ways :
    a) I redefined the environment variables to point to the new location of the source
    b) I did not use the command prompt provided by the Qt menu. Instead, I opened a normal command prompt and changed the directory to the new location of the source.
    c) After this was done I then executed the configure and minGW-make commands suggested by this post.

    In the future, after I verify that the gcc 4.3.2 compilation does what I need it to do, then I may reinstall Qt to my location of choice and afterwords overwrite library files with those compiled using the gcc 4.3.2 compiler noted here.

    One more small gotcha - when I cut and paste the external "C" code that corrects a Qt bug, the parentheses around the C character come up as weird characters and the compile fails. So if you see strange compiler errors, this may be the problem. Simply edit this class using a text editor and replace these weird characters that enclose the C with proper " symbols. When I did this everything worked great.

    Hope this helps for us newbies.

  7. The following user says thank you to gjshannon for this useful post:

    yuniarto.rahardjo (24th November 2008)

  8. #6
    Join Date
    Nov 2008
    Location
    Indonesia
    Posts
    1
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    Thanks for the information.
    It will be great help.

  9. #7
    Join Date
    Oct 2008
    Posts
    70
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    I had the same problem with Qt .4.4.3 & GCC3.4.5 on Windows.

    2 shiyutang: Does Trolltech know about this issue?

  10. #8
    Join Date
    May 2008
    Posts
    7
    Thanked 5 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    Quote Originally Posted by pastor View Post
    I had the same problem with Qt .4.4.3 & GCC3.4.5 on Windows.

    2 shiyutang: Does Trolltech know about this issue?
    I have reported these bugs to Trolltech. But only got a reply: gcc 4 is not supported. They won't fix these bugs.

  11. #9
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    Well maybe now Qt-4.5 has the open policy. Maybe they will finally accept it. They should reconsider adding support for it. We aren't in 2005/6 now Nokia. Please add support for it or accept patches that actually work
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  12. #10
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Building Qt 4.4.3 with GCC 4.3.2 on Windows XP

    If you do put the source in another location as I did, it will impact a number of items:
    You can solve this problem by using symbolic links to folders.
    The idea is to have one "main" folder (c:\qt\qt) which is in fact a symbolic link to the version of qt you're using at the moment (c:\qt\qt-4.5.2-gcc3, c:\qt\qt-4.5.2-gcc4, c:\qt\qt-4.5.2-vc...).
    To be able to quickly change current version of qt you can create a series of batch files using junction tool from M$

    Each batch file consists only from one line
    junction c:\qt\qt c:\qt\qt-[some version]

    You can also use this approach when you have more than one mingw version to be able to switch among them easily.

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.