﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-flyonok-文章分类-QT</title><link>http://www.cppblog.com/flyonok/category/6958.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 23 May 2008 08:38:17 GMT</lastBuildDate><pubDate>Fri, 23 May 2008 08:38:17 GMT</pubDate><ttl>60</ttl><item><title>compile with mingw on win32 platform</title><link>http://www.cppblog.com/flyonok/articles/48878.html</link><dc:creator>flyonok</dc:creator><author>flyonok</author><pubDate>Mon, 05 May 2008 03:46:00 GMT</pubDate><guid>http://www.cppblog.com/flyonok/articles/48878.html</guid><wfw:comment>http://www.cppblog.com/flyonok/comments/48878.html</wfw:comment><comments>http://www.cppblog.com/flyonok/articles/48878.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/flyonok/comments/commentRss/48878.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/flyonok/services/trackbacks/48878.html</trackback:ping><description><![CDATA[<h3>Requirements</h3>
<ul>
    <li>Windows NT, 2000 or XP (Windows 9.x may not work due to limitations of command.com)</li>
    <li>A svn client for svn checkouts (for example <a  href="http://subversion.tigris.org/">Subversion</a> or <a  href="http://tortoisesvn.net/">TortoiseSVN</a>)</li>
    <li>The latest full MinGW Package from <a  href="http://www.mingw.org/download.shtml">http://www.mingw.org</a> - currently this is
    <a  href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=82721&amp;release_id=158801">MinGW-5.1.1</a></li>
</ul>
<h3>Install MinGW</h3>
<ul>
    <li>Please follow the instructions at <a  href="http://mingw.sourceforge.net/docs.shtml">MinGW</a> documentation page.
    </li>
</ul>
<h3>Get the Q... sources</h3>
<ul>
    <li>by downloading a Qt 3 source snapshot from the <a  href="http://sourceforge.net/project/showfiles.php?group_id=49109&amp;package_id=42335" target="_blank">qtwin download area</a></li>
    <li>or from the svn repository (qtwin.svn.sourceforge.net)
    <p>checkout the sources with
    </p>
    <pre class="shell">c:\source&gt;  svn co https://qtwin.svn.sourceforge.net/svnroot/qtwin/qt-3/trunk qt-3</pre>
    </li>
</ul>
<h3>Compiling Qt with command line tools</h3>
<ul>
    <li>Open a cmd shell (make sure you haven't msys or cygwin in your PATH!)</li>
    <li>Setup Qt environment
    <pre class="shell">c:\source&gt; set QTDIR=&lt; qt3 source root &gt;<br>c:\source&gt; set MINGW=&lt; MinGW installation root &gt;<br>c:\source&gt; set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH%<br>c:\source&gt; set QMAKESPEC=win32-g++<br><br></pre>
    </li>
    <li>Configure and build the source<br>
    The script first creates link_includes.exe and configure.exe which are needed for bootstrap the
    build process. link_includes copies all relevant Qt headers into the include-directory. configure.exe
    is the replacement for the ./configure-script unter Unix/Linux. After that, qmake.exe is build and
    the compilation gets started.
    <pre class="shell">c:\source&gt; cd &lt; qt3 source root &gt;<br>c:\source\qt-3&gt; configure.bat [-fast] [-verbose]</pre>
    <p>configure knows some of the parameters of the x11 release configure script like <strong>-fast</strong>
    or <strong>-verbose</strong>.<br>
    For a full list see bin\configure.exe -help.</p>
    <p>This should build the whole Qt release. If it breaks you can restart compiling with</p>
    <pre class="shell">c:\source\qt-3&gt; mingw32-make [&lt; target &gt;]<br>  </pre>
    <p>for a list of all available targets see the toplevel Makefile</p>
    </li>
    <li>Start Qt applications
    <pre class="shell">c:\source\qt-3&gt; designer<br>c:\source\qt-3&gt; assistant<br>c:\source\qt-3&gt; linguist<br>c:\source\qt-3&gt; cd tutorial\t1<br>c:\source\qt-3\tutorial\t1&gt; t1</pre>
    </li>
</ul>
<h2>MinGW Notes</h2>
<ul>
    <li>by jay snyder: I found that I needed to remove all references to my
    cygwin installation from my path, or mingw32-make was trying to use
    c:\cygwin\bin\sh.exe as a shell instead of CMD.EXE. Since the mingw32
    makefiles for the win32-g++ qmakespec are written to use CMD.EXE, this
    is a problem. If I removed cygwin from my path, then the configure.bat
    build worked fine.</li>
    <li>by Ralf Habacker: Linking the shared Qt library needs much time.
    You can reduce the linking time by using the -static configure option.</li>
</ul><img src ="http://www.cppblog.com/flyonok/aggbug/48878.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/flyonok/" target="_blank">flyonok</a> 2008-05-05 11:46 <a href="http://www.cppblog.com/flyonok/articles/48878.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>