{"id":241,"date":"2014-08-24T09:53:10","date_gmt":"2014-08-24T01:53:10","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=241"},"modified":"2015-01-18T19:44:29","modified_gmt":"2015-01-18T11:44:29","slug":"%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91arm%e7%89%88-qt","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/241.html","title":{"rendered":"\u4ea4\u53c9\u7f16\u8bd1ARM\u7248 Qt"},"content":{"rendered":"<p style=\"color: #333333;\"><span style=\"font-weight: bold; color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0<\/span>\u56e0\u5b9e\u9645\u9879\u76ee\u9700\u6c42\uff0c\u9700\u5c06Qt\u7f16\u8bd1\u6210LINUX-ARM\u7248\uff0c\u4ee5\u4e0b\u4e3a\u6574\u4e2a\u64cd\u4f5c\u8fc7\u7a0b\uff0c\u4f7f\u7528Qt\u7f16\u5199\u7684\u7a0b\u5e8f\u5df2\u5728\u5b9e\u9645\u5f00\u53d1\u677f\u4e0a\u8fd0\u884c\uff0c\u5728\u6b64\u8d34\u51fa\uff0c\u4f46\u613f\u80fd\u4e3a\u9700\u8981\u7684\u670b\u53cb\u63d0\u4f9b\u4e0a\u5e2e\u52a9\u3002<\/p>\n<p style=\"color: #333333;\"><strong><span style=\"color: #3366ff;\">\u51c6\u5907\u5de5\u4f5c\uff1a<\/span><\/strong><br \/>\nLinux\u5185\u6838\u7248\u672c\uff1a<br \/>\nLinux 2.6.35-22-generic #33-Ubuntu<\/p>\n<p>\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\uff1a<br \/>\narm-none-linux-gnueabi 4.4.1<\/p>\n<p>Qt\u5b89\u88c5\u5305\uff1a<br \/>\nqt-everywhere-opensource-src-4.7.3.tar.gz<\/p>\n<p><span style=\"color: #3366ff;\"><strong>\u5b89\u88c5<\/strong><\/span><br \/>\n<strong>\u4e00.\u5b89\u88c5\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177<\/strong><br \/>\n1.\u672c\u673a\u4f7f\u7528\u7684\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u662f\uff1aarm-none-linux-gnueabi<\/p>\n<p>2.\u6dfb\u52a0\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u7684\u8def\u5f84\u81f3\u76f8\u5e94\u73af\u5883\u53d8\u91cf\u4e2d\uff1a<br \/>\nexport PATH=\/usr\/CodeSourcery\/Sourcery_G++_Lite\/bin\/:$PATH<\/p>\n<p>3.\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770barm-none-linux-gnueabi\u7f16\u8bd1\u5de5\u5177\u662f\u5426\u5b89\u88c5\u6210\u529f<br \/>\na. \u6267\u884c\uff1aarm-none-linux-gnueabi-g++ -v<br \/>\nb. \u6267\u884c\uff1aarm-none-linux-gnueabi-gcc -v<br \/>\n\u5982\u679c\u4ee5\u4e0a\u4e24\u6b65\u90fd\u80fd\u6b63\u786e\u6253\u5370\u5bf9\u5e94\u7684\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8868\u660earm-none-linux-gnueabi\u7f16\u8bd1\u5de5\u5177<br \/>\n\u5df2\u5b89\u88c5\u6210\u529f\uff01<\/p>\n<p><strong>\u4e8c.\u4ea4\u53c9\u7f16\u8bd1ARM\u7248Qt<\/strong><br \/>\n1.\u4e0b\u8f7dQt\u6e90\u7801\u5305 qt-everywhere-opensource-src-4.7.3.tar.gz\uff1b<\/p>\n<p>2.\u89e3\u538bQt\u6e90\u7801\u5305<br \/>\ntar -xvfz qt-everywhere-opensource-src-4.7.3.tar.gz<\/p>\n<p>3.\u4fee\u6539\u6587\u4ef6\uff1a \/usr\/local\/qt-4.7.3-linux-arm\/mkspecs\/qws\/linux-arm-g++\/qmake.conf<\/p>\n<p># \u8bbe\u7f6e\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u94fe\uff1a<br \/>\n# \u672c\u9879\u76ee\u4f7f\u7528\u7684\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u662f arm-none-linux-gnueabi-g++<br \/>\n#<br \/>\nQMAKE_CC \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 = arm-none-linux-gnueabi-gcc<br \/>\nQMAKE_CXX \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= arm-none-linux-gnueabi-g++<br \/>\nQMAKE_LINK \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= arm-none-linux-gnueabi-g++<br \/>\nQMAKE_LINK_SHLIB \u00a0 \u00a0 \u00a0 \u00a0= arm-none-linux-gnueabi-g++<\/p>\n<p>QMAKE_AR \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 = arm-none-linux-gnueabi-ar cqs<br \/>\nQMAKE_OBJCOPY \u00a0 \u00a0 \u00a0= arm-none-linux-gnueabi-objcopy<br \/>\nQMAKE_STRIP \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 = arm-none-linux-gnueabi-strip<\/p>\n<p>4.(\u5982\u6709\u9700\u8981\uff0c\u9700\u4fee\u6539g++.conf\u6587\u4ef6)<br \/>\n\u4fee\u6539\u6587\u4ef6\uff1a \/usr\/local\/qt-4.7.3-linux-arm\/mkspecs\/common\/g++.conf<\/p>\n<p># \u8bbe\u7f6e\u4f7f\u7528ARM\u9ad8\u7ea7\u7279\u6027\u7684\u7f16\u8bd1\u6807\u5fd7\uff1a<br \/>\n#<br \/>\nQMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp<\/p>\n<p>5.\u914d\u7f6eQt\u7f16\u8bd1\u9009\u9879<\/p>\n<p>\u8fdb\u5165Qt\u89e3\u538b\u76ee\u5f55\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<br \/>\n.\/configure -prefix \/usr\/local\/qt-4.7.3-linux-arm-install -embedded arm -host-little-endian -no-cups -no-3dnow -nomake examples -nomake demos -nomake docs -xplatform \/qws\/linux-arm-g++<\/p>\n<p>6.\u6267\u884c make \u547d\u4ee4\uff1b<br \/>\n\u8be5\u6b65\u9aa4\u5927\u81f4\u9700\u89812~3\u4e2a\u5c0f\u65f6<\/p>\n<p>7.\u6267\u884c make install \u547d\u4ee4\uff1b<\/p>\n<p>8.\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf<br \/>\nexport ARMQTDIR=\/usr\/local\/qt-4.7.3-linux-arm-install<br \/>\nexport PATH=$ARMQTDIR\/bin:$PATH<br \/>\nexport MANPATH=$ARMQTDIR\/man:$MANPATH<br \/>\nexport LD_LIBRARY_PATH=$ARMQTDIR\/lib:$LD_LIBRARY_PATH<\/p>\n<p>9.\u6d4b\u8bd5 ARM \u7248 QT \u662f\u5426\u5b89\u88c5\u5e76\u914d\u7f6e\u6210\u529f\uff1a<br \/>\na. \u6267\u884c\uff1aqmake -v<br \/>\n\u6253\u5370\u4ee5\u4e0b\u5bf9\u5e94\u4fe1\u606f\uff1a<br \/>\nQMake version 2.01a<br \/>\nUsing Qt version 4.7.3 in \/usr\/local\/qt-4.7.3-linux-arm-install\/lib<br \/>\nb. \u6267\u884c\uff1awhich qmake<br \/>\n\u6253\u5370\u4ee5\u4e0b\u5bf9\u5e94\u4fe1\u606f\uff1a<br \/>\n\/usr\/local\/qt-4.7.3-linux-arm-install\/bin\/qmake<\/p>\n<p>c. \u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u6d4b\u8bd5\u7a0b\u5e8f,\u6587\u4ef6\u540d\u4e3ahello.cpp\uff0c\u8fdb\u5165\u8be5\u6587\u4ef6\u76ee\u5f55\uff0c\u8fdb\u884c\u5de5\u7a0b\u7f16\u8bd1\uff0c\u770b\u662f\u5426\u80fd\u6b63\u786e\u901a\u7f16\u8bd1<\/p>\n<p>hello.cpp\u6e90\u7801\uff1a<br \/>\n#include &lt;QApplication&gt;<br \/>\n#include &lt;QDebug&gt;<br \/>\nint main(int argc,char *argv[])<br \/>\n{<br \/>\nqDebug(\"Hello, welcome to Qt world!\");<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>\u987a\u5e8f\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<br \/>\n@1. \u6267\u884c\uff1aqmake -project hello1.cpp<br \/>\n\u751f\u6210 hello1.pro \u5de5\u7a0b\u6587\u4ef6<br \/>\n@2. \u6267\u884c\uff1aqmake hello1.pro<br \/>\n\u751f\u6210 Makefile \u6587\u4ef6<br \/>\n@3. \u6267\u884c\uff1amake<br \/>\n\u751f\u6210 hello.o, hello \u6587\u4ef6<\/p>\n<p>\u5982\u679c\u6267\u884c@2\u6b65\u9aa4\u65f6\u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef\uff1a<br \/>\nQMAKESPEC has not been set, so configuration cannot be deduced.<br \/>\nError processing project file: hello1.pro<br \/>\n\u5219\u662f QMAKESPEC \u53d8\u91cf\u6ca1\u6709\u8bbe\u7f6e\u597d\uff0c\u6267\u884c\uff1a<br \/>\nexport QMAKESPEC=\/usr\/local\/qt-4.7.3-linux-arm-install\/mkspecs\/qws\/linux-arm-g++<\/p>\n<p>\u5982\u679c\u4ee5\u4e0a\u5bf9\u5e94\u7684\u4fe1\u606f\u90fd\u80fd\u6b63\u786e\u6253\u5370\uff0c\u8bf4\u660e ARM \u7248 QT\u00a0\u5b89\u88c5\u5e76\u914d\u7f6e\u6210\u529f\uff0c\u5927\u529f\u544a\u6210\uff0c\u53ef\u4ee5\u4f60\u7684ARM\u7248QT\u4e4b\u65c5\u4e86\uff01<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u53cb\u60c5\u63d0\u793a\uff1a<br \/>\n\u5728\u4ee5\u4e0a\u6240\u6709\u8fc7\u7a0b\u4e2d\uff0c\u8bf7\u52a1\u5fc5\u6ce8\u610f\u76f8\u5173\u8def\u5f84\uff0c\u53ca\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e\uff0c\u53e6\u5916\uff0c\u8bf7\u6839\u636e\u81ea\u5df1\u7684\u8def\u5f84\u5bf9\u76f8\u5e94\u90e8\u5206\u505a\u4fee\u6539\u3002<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 \u00a0 \u00a0\u56e0\u5b9e\u9645\u9879\u76ee\u9700\u6c42\uff0c\u9700\u5c06Qt\u7f16\u8bd1\u6210LINUX-ARM\u7248\uff0c\u4ee5\u4e0b\u4e3a\u6574\u4e2a\u64cd\u4f5c\u8fc7\u7a0b\uff0c\u4f7f\u7528Qt\u7f16\u5199\u7684\u7a0b\u5e8f\u5df2\u5728\u5b9e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,152],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-arm","tag-qt"],"views":1492,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}