<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shiyu Tang的财经博客 &#187; Qt</title>
	<atom:link href="http://www.shiyutang.com/tag/qt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shiyutang.com</link>
	<description>有关我的投资、生活以及爱好</description>
	<lastBuildDate>Sun, 11 Dec 2011 07:41:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>在Windows XP下用GCC 4.3.2编译Qt 4.4.3实战</title>
		<link>http://www.shiyutang.com/2008/10/15/%e5%9c%a8windows-xp%e4%b8%8b%e7%94%a8gcc-432%e7%bc%96%e8%af%91qt-443%e5%ae%9e%e6%88%98/</link>
		<comments>http://www.shiyutang.com/2008/10/15/%e5%9c%a8windows-xp%e4%b8%8b%e7%94%a8gcc-432%e7%bc%96%e8%af%91qt-443%e5%ae%9e%e6%88%98/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 05:19:55 +0000</pubDate>
		<dc:creator>Shiyu Tang</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[MinGW]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.shiyutang.com/2008/10/15/%e5%9c%a8windows-xp%e4%b8%8b%e7%94%a8gcc-432%e7%bc%96%e8%af%91qt-443%e5%ae%9e%e6%88%98/</guid>
		<description><![CDATA[1.下载GCC 4.3.2和工具包的编译版，在这里：http://www.tdragon.net/recentgcc/ 点“TDM/MinGW Installer 1.808.3”下载，并且安装好； 2.下载Qt 4.4.3。去这里下载：ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.4.3-mingw.exe 完成后安装。注意选了MinGW编译器位置之后安装程序会报错，不用管它，确定安装即可； 3.在环境变量的PATH中增加你的MinGW\bin和Qt\4.4.3\bin的详细位置； 4.Qt 4.4.3可能有些小bug，编译时会报错，所以需要修改以下一些文件： (1) Qt\4.4.3\src\corelib\arch\qatomic_windows.h：找到第386-392行，应该是这样的： extern &#8220;C&#8221; { __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); } 请改成这样： extern &#8220;C&#8221; { __declspec(dllimport) long __stdcall InterlockedCompareExchange(volatile long [...]]]></description>
			<content:encoded><![CDATA[<p>1.下载GCC 4.3.2和工具包的编译版，在这里：<a href="http://www.tdragon.net/recentgcc/" target="_blank">http://www.tdragon.net/recentgcc/</a> 点“TDM/MinGW Installer 1.808.3”下载，并且安装好；</p>
<p>2.下载Qt 4.4.3。去这里下载：<a href="ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.4.3-mingw.exe" target="_blank">ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.4.3-mingw.exe</a> 完成后安装。注意选了MinGW编译器位置之后安装程序会报错，不用管它，确定安装即可；</p>
<p>3.在环境变量的PATH中增加你的MinGW\bin和Qt\4.4.3\bin的详细位置；</p>
<p>4.Qt 4.4.3可能有些小bug，编译时会报错，所以需要修改以下一些文件：</p>
<p>(1) Qt\4.4.3\src\corelib\arch\qatomic_windows.h：找到第386-392行，应该是这样的：<br />
extern &#8220;C&#8221; {<br />
__declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);<br />
__declspec(dllimport) long __stdcall InterlockedIncrement(long *);<br />
__declspec(dllimport) long __stdcall InterlockedDecrement(long *);<br />
__declspec(dllimport) long __stdcall InterlockedExchange(long *, long);<br />
__declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);<br />
}<br />
请改成这样：<br />
extern &#8220;C&#8221; {<br />
__declspec(dllimport) long __stdcall InterlockedCompareExchange(volatile long *, long, long);<br />
__declspec(dllimport) long __stdcall InterlockedIncrement(volatile long *);<br />
__declspec(dllimport) long __stdcall InterlockedDecrement(volatile long *);<br />
__declspec(dllimport) long __stdcall InterlockedExchange(volatile long *, long);<br />
__declspec(dllimport) long __stdcall InterlockedExchangeAdd(volatile long *, long);<br />
}</p>
<p>(2) Qt\4.4.3\src\corelib\io\qfsfileengine_win.cpp：找到第67-68行，应该是这样的：<br />
#define SECURITY_WIN32<br />
#include &lt;security.h&gt;<br />
请在这两行中间加上一行：#include &lt;subauth.h&gt;，使其像这样：<br />
#define SECURITY_WIN32<br />
#include &lt;subauth.h&gt;<br />
#include &lt;security.h&gt;</p>
<p>(3) Qt\4.4.3\src\gui\inputmethod\qwininputcontext_win.cpp，找到第500行，应该是这样：<br />
bool QWinInputContext::endComposition()<br />
请在这行前面加上一行extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);，使其像这样：<br />
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);<br />
bool QWinInputContext::endComposition()</p>
<p>5.OK， 现在应该可以编译了。点开始菜单中的“Qt by Nokia v4.4.3 (OpenSource)”-&gt;“Qt 4.4.3 Command Prompt”，然后输入“configure -debug-and-release -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg”回车进行configure，几分钟之后configure完成，再输入“mingw32-make”回车就可以编译了。编译可 能需要3个小时时间（我的电脑CPU是Intel Core Duo T7500的，内存是2G），大概需要4G空间。编译完成后，请输入“mingw32-make clean”清除中间文件，这样可以使占用空间减少到1.95G。</p>
<p>6.好了。请享用GCC 4.3.2和Qt 4.4.3带给你的快乐吧。</p>
<p>请有空来我的网站看看啦：<a href="http://www.shiyutang.com//" target="_blank">http://www.shiyutang.com</a>。转载时请注明作者是shiyutang，并且包含我的个人网站地址 <a href="http://www.shiyutang.com//" target="_blank">http://www.shiyutang.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shiyutang.com/2008/10/15/%e5%9c%a8windows-xp%e4%b8%8b%e7%94%a8gcc-432%e7%bc%96%e8%af%91qt-443%e5%ae%9e%e6%88%98/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>在Windows XP中安装MinGW、Qt4和Eclipse Integration的指南</title>
		<link>http://www.shiyutang.com/2008/05/03/%e5%9c%a8windows-xp%e4%b8%ad%e5%ae%89%e8%a3%85mingw%e3%80%81qt4%e5%92%8ceclipse-integration%e7%9a%84%e6%8c%87%e5%8d%97/</link>
		<comments>http://www.shiyutang.com/2008/05/03/%e5%9c%a8windows-xp%e4%b8%ad%e5%ae%89%e8%a3%85mingw%e3%80%81qt4%e5%92%8ceclipse-integration%e7%9a%84%e6%8c%87%e5%8d%97/#comments</comments>
		<pubDate>Fri, 02 May 2008 17:05:02 +0000</pubDate>
		<dc:creator>Shiyu Tang</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[MinGW]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.shiyutang.com/2008/05/03/%e5%9c%a8windows-xp%e4%b8%ad%e5%ae%89%e8%a3%85mingw%e3%80%81qt4%e5%92%8ceclipse-integration%e7%9a%84%e6%8c%87%e5%8d%97/</guid>
		<description><![CDATA[在Windows XP中安装MinGW、Qt4和Eclipse Integration花了我不少时间。我遇到了一些问题，而且我发现也有很多其他人也遇到了，比如Build Debug Libraries不能编译、&#8221;mingw32-make[2]: *** [..\..\lib\QtCored4.dll] Error 1&#8243;，等等，所以我写了这篇指南，希望能让大家省一些时间。 1. 下载&#8221;Automated MinGW Installer&#8221; (http://sourceforge.net/project/showfiles.php?group_id=2435)，安装它。注意选上g++和mingw32-make； 2. 下载&#8221;GNU Source-Level Debugger&#8221; (http://sourceforge.net/project/showfiles.php?group_id=2435)，把它解压缩到您安装MinGW的地方。当解压软件你是不是覆盖同名文件时，一律选“否”； 3. 下载&#8221;Qt/Windows Open Source Edition&#8221; (http://trolltech.com/developer/downloads/qt/windows)。安装它； 4. 下载&#8221;Eclipse IDE for C/C++ Developers&#8221; (http://www.eclipse.org/downloads/)，把它解压缩到某个文件夹去。如果你已经有开发Java的Eclipse了，可以只安装cdt插件； 5. 下载&#8221;Qt Eclipse Integration Downloads&#8221; (http://trolltech.com/developer/downloads/qt/eclipse-integration-download)，安装它； 6. 设置系统的环境变量。这一步很重要。如果有什么地方没有正确完成的话，以后可能出现不少问题。E:\Develop是我安装MinGW的Qt地方。 把E:\Develop\MinGW\bin、E:\Develop\Qt\4.3.4\bin和E:\Develop\Qt\4.3.4\lib添加到Path； 把E:\Develop\MinGW\lib和E:\Develop\Qt\4.3.4\lib添加到Lib (如果没有Lib，请创建一个)； 把E:\Develop\MinGW\include和E:\Develop\Qt\4.3.4\include添加到Include (如果没有Include，请创建一个)； 重新启动计算机； 7. 在开始菜单\所有程序\Qt by Trolltech v4.3.4 (OpenSource)里，找到Qt 4.3.4 (Build Debug [...]]]></description>
			<content:encoded><![CDATA[<p>在Windows XP中安装MinGW、Qt4和Eclipse Integration花了我不少时间。我遇到了一些问题，而且我发现也有很多其他人也遇到了，比如Build Debug Libraries不能编译、&#8221;mingw32-make[2]: *** [..\..\lib\QtCored4.dll] Error 1&#8243;，等等，所以我写了这篇指南，希望能让大家省一些时间。</p>
<p>1. 下载&#8221;Automated MinGW Installer&#8221; (<a href="http://sourceforge.net/project/showfiles.php?group_id=2435" target="_blank">http://sourceforge.net/project/showfiles.php?group_id=2435</a>)，安装它。注意选上g++和mingw32-make；<br />
2. 下载&#8221;GNU Source-Level Debugger&#8221; (<a href="http://sourceforge.net/project/showfiles.php?group_id=2435" target="_blank">http://sourceforge.net/project/showfiles.php?group_id=2435</a>)，把它解压缩到您安装MinGW的地方。当解压软件你是不是覆盖同名文件时，一律选“否”；<br />
3. 下载&#8221;Qt/Windows Open Source Edition&#8221; (<a href="http://trolltech.com/developer/downloads/qt/windows" target="_blank">http://trolltech.com/developer/downloads/qt/windows</a>)。安装它；<br />
4. 下载&#8221;Eclipse IDE for C/C++ Developers&#8221; (<a href="http://www.eclipse.org/downloads/" target="_blank">http://www.eclipse.org/downloads/</a>)，把它解压缩到某个文件夹去。如果你已经有开发Java的Eclipse了，可以只安装cdt插件；<br />
5. 下载&#8221;Qt Eclipse Integration Downloads&#8221; (<a href="http://trolltech.com/developer/downloads/qt/eclipse-integration-download" target="_blank">http://trolltech.com/developer/downloads/qt/eclipse-integration-download</a>)，安装它；<br />
6. 设置系统的环境变量。这一步很重要。如果有什么地方没有正确完成的话，以后可能出现不少问题。E:\Develop是我安装MinGW的Qt地方。<br />
把E:\Develop\MinGW\bin、E:\Develop\Qt\4.3.4\bin和E:\Develop\Qt\4.3.4\lib添加到Path；<br />
把E:\Develop\MinGW\lib和E:\Develop\Qt\4.3.4\lib添加到Lib (如果没有Lib，请创建一个)；<br />
把E:\Develop\MinGW\include和E:\Develop\Qt\4.3.4\include添加到Include (如果没有Include，请创建一个)；<br />
重新启动计算机；<br />
7. 在开始菜单\所有程序\Qt by Trolltech v4.3.4 (OpenSource)里，找到Qt 4.3.4 (Build Debug Libraries)，然后执行它。注意这需要2个小时时间，并且安装MinGW的分区需要3GB的空间；<br />
8. 在Eclipse中编写一个Qt程序；<br />
9. 点击臭虫图标，选&#8221;Open Debug Dialog&#8230;&#8221;在C/C++ Local Application添加一个新的配置，注意C/C++ Application那一栏里应该是&#8221;debug/*.exe&#8221;，而不是&#8221;release/*.exe&#8221;！点Debug选项卡，再把Debugger选择为gdb/mi，现在你应该可以debug了；<br />
10. 终于完了。期望你不要再遇到这类问题。</p>
<p>注意，第6步非常重要。你必须在添加系统环境变量之后重启计算机。</p>
<p>我希望这份指南能帮助你。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shiyutang.com/2008/05/03/%e5%9c%a8windows-xp%e4%b8%ad%e5%ae%89%e8%a3%85mingw%e3%80%81qt4%e5%92%8ceclipse-integration%e7%9a%84%e6%8c%87%e5%8d%97/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

