锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲AV无码永不,亚洲男人av香蕉爽爽爽爽,一本久久a久久精品亚洲http://www.tkk7.com/felicity/category/5831.htmlall gonezh-cnFri, 02 Mar 2007 06:22:34 GMTFri, 02 Mar 2007 06:22:34 GMT60Qt 4涓嬭繛鎺ySQL鏁版嵁搴?/title><link>http://www.tkk7.com/felicity/archive/2006/08/28/66280.html</link><dc:creator>all gone</dc:creator><author>all gone</author><pubDate>Mon, 28 Aug 2006 12:57:00 GMT</pubDate><guid>http://www.tkk7.com/felicity/archive/2006/08/28/66280.html</guid><wfw:comment>http://www.tkk7.com/felicity/comments/66280.html</wfw:comment><comments>http://www.tkk7.com/felicity/archive/2006/08/28/66280.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/felicity/comments/commentRss/66280.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/felicity/services/trackbacks/66280.html</trackback:ping><description><![CDATA[鍓嶅ぉ鍒氳浜嗕釜Qt4for windows錛屽彂鐜板畨瑁呯殑鏃跺橫ySQL絳夋暟鎹簱鎻掍歡閮芥病鏈夊畨瑁咃紝鍍廞t X11鐗堜竴鏍鳳紝閮介渶瑕佽嚜宸卞畨瑁呰繖浜涙彃浠躲?<br /><br />鍦≦t鐨勫畨瑁呯洰褰旵:\Qt4.1.2\涓嬶紝鏈変釜src鐩綍錛岃繘鍏lugins\sqldrivers\mysql錛屽彲浠ョ湅鍒頒袱涓枃浠訛紝main.cpp鍜宮ysql.pro,寰堟樉鐒惰鐢╭make鏉ュ畬鎴愮紪璇戙佺敓鎴愮洰鏍囥?<br /><br />緙栬瘧鍓嶏紝棣栧厛淇濊瘉渚濊禆鐨凪ySQL澶存枃浠跺拰搴撴枃浠舵紜傞鍏圡ySQL瀹夎鐩綍涓嬬殑include涓殑鎵鏈夋枃浠舵嫹鍒皅make鏃惰兘鎵懼埌鐨勭洰褰曚笅錛屾帴鐫浠巐ib/opt鐩綍涓嬫嫹鍑簂ibmysql.a,鍏跺疄lib/opt涓嬪彧鏈塴ibmysql.lib鍜宭ibmysql.dll錛屼粠緗戜笂鎼滀簡涓涓嬫壘鍒頒竴涓柟娉曚粠libmysql.dll鐢熸垚libmysql.a: <br /><br />1 銆佸畨瑁呭ソMySQL 錛堝鏋滀笉鎰挎剰瀹夎錛屾壘涓猯ibmySQL.dll鏂囦歡涔熷彲浠ワ級 <br /><br />2銆佷笅杞絇exports宸ュ叿 <br /><br />3銆佽漿鎹㈡搷浣滐細 pexports libmysql.dll > libmysql.def <br /><br />4銆佷嬌鐢∕inGW鐨?dlltool杞崲鎴愪負libmysql.a鏂囦歡銆俤lltool --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a -k <br /><br />5銆佸皾璇曟槸鍚︽垚鍔燂細 <br />灝嗙敓鎴愮殑libmysql.a 鎷峰埌qmake鐨刲ib鎼滅儲璺緞涓嬪悗鍦╬lugins\sqldrivers\mysql鐩綍涓嬪仛錛?<br />qmake -project <br />qmake <br />make <br /><br />濡傛灉鍐嶅嚭鐜拌薄mysql_connect@xx 錛坸x鏄暟瀛楋級鐨勯敊璇彁紺恒傚氨鎵ц絎?姝ャ?<br /><br />6銆佷慨鏀筶ibmysql.def鏂囦歡錛岀粰mysql_connect鍔犱笂@xx錛屽嵆mysql_connect@xx <br /><br />7銆侀噸鍋氱4姝?<br /><br />8銆佺劧鍚庡皾璇曠5姝ワ紝濡傛灉榪樻槸鍑虹幇閿欒鎻愮ず銆傚氨浣滅6姝ャ備竴鐩村埌娌℃湁閿欒涓烘銆?<br /><br />鏈鍚嶤:\Qt4.1.2\plugins\sqldrivers涓嬪皢浼氱敓鎴愰渶瑕佺殑libqsqlmysql.a鍜宷sqlmysql.dll銆?<br /><br />鎵句簡涓涓祴璇曟枃浠訛紝閫氳繃銆?<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">#include聽<QtSql>聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />#include聽<QtGui>聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />bool聽createConnection(){聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />QSqlDatabase聽db聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽QSqlDatabase::addDatabase(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">QMYSQL</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">db.setHostName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">localhost</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">db.setDatabaseName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">test</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">db.setUserName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">test</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">db.setPassword(</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />if(!db.open()){聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />QMessageBox::critical(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">聽QObject::tr(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Database聽Error</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽db.lastError().text())</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />return聽false</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">}聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />QSqlQuery聽query</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">//query.exec(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">insert聽into聽book聽values(聽3,聽'title',聽'author')聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">query.exec(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">select聽title聽,聽author聽from聽book聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />while聽(query.next())聽{聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽QString聽title聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽query.value(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">).toString()</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽QString聽author聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽query.value(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">).toString()</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />QMessageBox::critical(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">聽title</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">author)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />}聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />return聽true</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">}聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />int聽main(int聽argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">char**聽argv){聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />QApplication聽app(argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">聽argv)</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽if聽(!createConnection()){聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />return聽</span><span style="COLOR: #000000">1</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">}聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽return聽app.exec()</span><span style="COLOR: #008000">;</span><span style="COLOR: #008000">聽</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />}聽<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div><br /><img src ="http://www.tkk7.com/felicity/aggbug/66280.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/felicity/" target="_blank">all gone</a> 2006-08-28 20:57 <a href="http://www.tkk7.com/felicity/archive/2006/08/28/66280.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Eclipse + CDT + MinGW 涓嬬紪鍐橯T紼嬪簭http://www.tkk7.com/felicity/archive/2006/06/16/53380.htmlall goneall goneFri, 16 Jun 2006 11:45:00 GMThttp://www.tkk7.com/felicity/archive/2006/06/16/53380.htmlhttp://www.tkk7.com/felicity/comments/53380.htmlhttp://www.tkk7.com/felicity/archive/2006/06/16/53380.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/53380.htmlhttp://www.tkk7.com/felicity/services/trackbacks/53380.html
鐜錛?br />錛?錛夊畨瑁匛clipse + CDT + MinGW
錛?錛夊畨瑁匭T for Windows
錛?錛夊畨瑁匭T plugin for Eclipse 錛歰rg.eclipse.qt-1.0.2.zip錛屽湪Preference閲岃濂界浉鍏寵礬寰勩?/p>

鏂板緩涓涓?QT project錛屽皢hello銆俢pp澶嶅埗鍒板伐紼嬩腑錛?br />#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[]){

聽QApplication app(argc, argv);

聽QPushButton hello("Hello world!");

聽hello.resize(100, 30);
聽hello.show();

聽return app.exec();
}

build鍚庣敓鎴怣akefile錛屾柊寤轟袱涓狹ake Target:all,clean
Make all 鍚庡彂鐜版壘涓嶅埌libQtCored4.a絳夋枃浠訛紝鍦≦T鐨刲ib鐩綍涓嬫壘鍒扮浉搴旂殑libQtCore4.a錛屽鍒跺悗閲嶅懡鍚嶄負libQtCored4.a錛?br />鍏朵粬搴撴枃浠剁被浼鹼紝鏈鍚庣紪璇戦氳繃錛岃繍琛屽悗鍑虹幇甯ello鎸夐挳鐨勭獥鍙c?/p>



all gone 2006-06-16 19:45 鍙戣〃璇勮
]]>
tmake&Qt寮鍙?http://www.tkk7.com/felicity/archive/2005/12/09/23190.htmlall goneall goneFri, 09 Dec 2005 11:18:00 GMThttp://www.tkk7.com/felicity/archive/2005/12/09/23190.htmlhttp://www.tkk7.com/felicity/comments/23190.htmlhttp://www.tkk7.com/felicity/archive/2005/12/09/23190.html#Feedback0http://www.tkk7.com/felicity/comments/commentRss/23190.htmlhttp://www.tkk7.com/felicity/services/trackbacks/23190.html浣跨敤tmake鐢熸垚Qt紼嬪簭鐨刴akefile鏂囦歡鐪熺殑鏄緢綆鍗?鏈潵tmake灝辨槸鍙戝竷Qt閭d釜鍏徃鐨勪駭鍝佸晩. 鑷繁緙栧啓.h鍜?cpp鏂囦歡鏃?tmake鐨勭敤娉曞彲浠ュ湪瀹夎鏂囨。閲屾壘鍒? 浣跨敤Qt Designer鏃跺憿,鐢熸垚鐨勬槸.ui鏂囦歡,榪欐椂涔熷彲浠ョ敤tmake鐨? 鍋囪鐢熸垚鐨?ui鏂囦歡鍚嶄負mainform.ui,鑷繁鍐欎竴涓畝鍗曠殑main.cpp鏂囦歡:

#include "mainform.h"

int main(int argc,char **argv)

 {

QApplication app(argc,argv);

MainForm mainform;

app.setMainWidget(&mainform);

 mainform.show();

return app.exec();

}

鎺ヤ笅鏉ュ氨鍙互浣跨敤tmake浜?

progen -o main.pro

 tmake main.pro -o Makefile

 make

 ./main 鍛靛懙,鍙互浜?



all gone 2005-12-09 19:18 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲爆乳少妇无码激情| 亚洲欧洲无码AV电影在线观看| 可以免费看黄的网站| 亚洲无砖砖区免费| 18禁止看的免费污网站| 2021在线观看视频精品免费| 免费A级毛片av无码| 在线观看的免费网站无遮挡| 亚洲视频免费在线看| 成人免费的性色视频| 黄色成人网站免费无码av| 成人免费一区二区三区在线观看| 成年女人免费视频播放77777| 四虎成人免费观看在线网址| 国产成人无码区免费A∨视频网站| 小小影视日本动漫观看免费| 国产一区二区三区在线免费观看| 亚洲毛片av日韩av无码 | 成av免费大片黄在线观看| 国产区在线免费观看| 国产拍拍拍无码视频免费| 97在线视频免费| 最近的免费中文字幕视频| 日韩a级毛片免费视频| 国产精品亚洲综合专区片高清久久久 | 青娱乐在线免费观看视频| sihu国产精品永久免费| 高清永久免费观看| 最近2019中文字幕免费直播| 无人在线观看完整免费版视频| 国产在线观看www鲁啊鲁免费| 亚洲中文字幕无码专区 | 亚洲AV网站在线观看| 亚洲色精品vr一区二区三区| 亚洲综合视频在线观看| 亚洲色无码国产精品网站可下载| 欧洲乱码伦视频免费国产| 久久精品免费观看国产| 成人黄软件网18免费下载成人黄18免费视频| 国产大片免费观看中文字幕| 亚洲国产精品嫩草影院在线观看|