1.linuxqtç¼è¯
linuxqtç¼è¯
linuxä¸æ§è¡qtç¨åºæä¹ç¼è¯è¿è¡ï¼1ãå¨Linuxä¸çå½ä»¤è¡ç¼è¾ç¨åºï¼#mkdirhello//mkdirå½ä»¤å建ä¸ä¸ªhelloç®å½#cdhello//cdå½ä»¤åæ¢å°åæå建çhelloç®å½#vimain.cpp//å¨helloç®å½ä¸ç¨viå建ä¸ä¸ªmain.cppæ件å°ä¸é¢ç代ç è¾å ¥å°main.cppæ件ä¸#include
ææ ·å¨ubuntuä¸å®è£ qtåµå ¥å¼ï¼
1cd~/Qtenv 2 3chmodu+xqt-sdk-linux-x-opensource-..bin 4 5./qt-sdk-linux-x-opensource-..bin 为äºæ件管çæ¹ä¾¿ï¼å°sdkä¹å®è£ å¨Qtenvæ件夹ä¸ã 2ã解åæºä»£ç å å¨ç¨æ·ç®å½ä¸å»ºç«ä¸ä¸ªQtenvç®å½ï¼ç¨äºåæ¾ç¼è¯æºæ件ã mkdir$HOME/Qtenv å¨qtembeddedç®å½ä¸å建armåxç®å½ãå建è¿ä¸¤ä¸ªç®å½ä¸»è¦æ¯ä¸ºäºç¼è¯ä¸ä¸ªç¨æ·armå¼åççQTEï¼å¦ä¸ä¸ªç®å½ç¨äºåæ¾ç¨äºqvfbçxä¸QTEï¼è¿æ ·æ¼ç¤ºåå¼åé½å¾æ¹ä¾¿ã 1cd~/Qtenv 2mkdirarmx æ¥ä¸æ¥å°æºä»£ç å åå«å¤å¶å°armåxä¸å¹¶è§£å缩ãè¿æ ·åè½ç¶æµªè´¹äºä¸äºç¡¬ç空é´ï¼psï¼å¨å®¿ä¸»æºä¸ç硬ç太ä¸å¼é±äºï¼ï¼ä½è½ä¸ºå°æ¥åé ç½®åç¼è¯èçå¾å¤æ¶é´ã 1cd~/Qtenv 2mvqt-everywhere-opensource-src-4.6.3.tar.bz2./arm 3cd~/Qtenv/arm 4tarxjvfqt-everywhere-opensource-src-4.6.3.tar.bz2 5 6cd~/Qtenv/x 7mvqt-everywhere-opensource-src-4.6.3.tar.bz2./x 8tarxjvf./x/qt-everywhere-opensource-src-4.6.3.tar.bz2 解å缩ååå«é对armå¹³å°åxå¹³å°è¿è¡é ç½®ï¼é ç½®åå¯è¾å ¥ ./configure-embedded-help è¿è¡é 置帮å©æ¥è¯¢ï¼æ ¹æ®å¹³å°é ç½®ï¼å¹¶ç¼è¯åå®è£ æ件ãå ¶å½ä»¤ä»£ç å¦ä¸ï¼ 1cd~/Qtenv/arm 2./configure-prefix$HOME/Qtenv/arm-embeddedarm-nomakedocs-nomakedemo-nomakeexamples 3make 4makeinstall 5 6cd~/Qtenv/x 7./configure-prefix$HOME/Qtenv/arm-embeddedx-nomakedocs-nomakedemo-nomakeexamples 8make 9makeinstall å¨ç»è¿æ¼«é¿çé ç½®ãç¼è¯åå°±å®æäºQTEçå®è£ ãæ¬äººå¨armççç¼è¯è¿ç¨ä¸åºç°è¿ä¸¤ä¸ªé误ï¼å¨åèãå¨arm-linux-gcc3.4.1ä¸ç¼è¯qt-embedded-4.6.2ãå®æç¼è¯ã å®æç¼è¯åå®è£ åéè¦å¯¹ç³»ç»çç¯å¢åéè¿è¡è®¾ç½®ï¼è®¾ç½®å¯ä»¥æ¯ä¸´æ¶æ§è®¾ç½®åæ°¸ä¹ æ§è®¾ç½®ã临æ¶è¡è®¾ç½®æ¯ç´æ¥å¨å½ä»¤çªå£è¾å ¥ 1exportQTENV=$HOME/Qtenv 2exportQTXDIR=$QTENV/qtsdk 3exportQTEDIR=$QTENV/x 4exportPATH=$QTXDIR/qt/bin:$PATH 5exportLD_LIBRARY_PATH=$QTXDIR/lib:$LD_LIBRARY_PATH 6exportQVFBDIR=$QTXDIR/qt/bin 7exportQTEMAKEDIR=$QTEDIR/bin 以ä¸è¿äºåéå¯ä»¥æ ¹æ®èªå·±çå好è¿è¡å¢å ãè¿ç§è®¾ç½®æ¹æ³å¨å ³éå½åå½ä»¤ç»ç«¯å失æã 第äºç§æ¹å¼æ¯å¨å½åç¨æ·ç主ç®å½ä¸ï¼ç¼è¾.bash_profileæ件ï¼å å ¥ä¸è¿°å½ä»¤è¡ï¼ä¿åéå¯å½ä»¤ç»ç«¯å³å¯ã
å¦ä½å¨ARMLinuxç¯å¢ä¸æ建QTè¿è¡ç¯å¢ï¼
1ãå¯ä»¥2ãQtCreatoråªæ¯ä¸ä¸ªéæå¼åå·¥å ·ï¼è¿ä¸ªçæ¬éæï¼ç½ä¸ä¸å°±å¯ä»¥ï¼Qteä¸æ¯ç¨ææ°ï¼èæ¯æ好ç¨è·ä½ å¨Linuxå¼å°å¼åä¸æ ·çãé¦å è¦å¨Linuxä¸äº¤åç¼è¯Qteçåºï¼ç¶ååå°Libè¿äºæ件移æ¤å¨æ¿åä¸ï¼æåéè¿äº¤åç¼è¯å¥½çåºå»ç¼è¯ä½ å¨pc
æ èæ´¾ä¸ææ ·è¿è¡ç§»æ¤çQTç¨åºï¼
ä½ å¯ä»¥åèSQLiteStudioè¿ä¸ªQtåç跨平å°SQLite管çå·¥å ·,编译编译报错tcpdump源码下载å®èªå·±æå äºä¾èµçQtåº,å¯ä»¥åå°è§£åå³ç¨,å ¼å®¹ä¸åLinuxåè¡ç.éçå ¶å®è·WindowsçQtç¨åºèªå¸¦Qtåºå·®ä¸å¤.
ç¼è¯åç»è¿æ¥å¨ä¼ ä¸ä¸ªåæ°:
说æ:
-Wl表示åè¯ç¼è¯å¨å°åé¢çåæ°ä¼ éç»é¾æ¥å¨.
rpathæ¯gccçä¸ä¸ªåæ°,å½ç¨åºè¢«å è½½æ¶,ä¼æ寻rpathç®å½,寻æ¾å ±äº«åº.
rpathæ·»å çç®å½ä¿¡æ¯ä¿åå¨å¯æ§è¡æ件ä¸.
$ORIGIN表示å¯æ§è¡æ件æå¨çç®å½.
ä¹å°±æ¯è¿è¡æ¶ç¨åºä¼å å»èªå·±æå¨çç®å½çlibéå»å è½½ä¾èµåº,没æçè¯åå»ç³»ç»åºéæ¾.
å¦æä½ çç¨åºå¨ç¼è¯æ¶æ²¡æä¼ érpathåæ°,é£ä½ ä¹å¯ä»¥ç¨patchelfæ¥ä¿®æ¹ä½ ç¨åºçrpath:
注æ:patchelfä¿®æ¹æ件ååstripä¼å¯¼è´æ件æå.
æ以åºè¯¥å ç¨stripå é¤ç¬¦å·è¡¨ç¼©å°äºè¿å¶æ件,ç¶ååç¨patchelf设置rpath.
é¢å¤è¯,Androidä¸æ¢æ²¡æglibcåº,ä¹æ²¡æåºé¾æ¥å¨ld-linux.so.3.
å¦æä½ è¦æDebianARM(å¦æ èæ´¾Raspbian)ä¸ç软件æ¾å°Androidä¸è·,ä½ ä¸æ ·å¯ä»¥æå ç¨åºä¾èµçå ±äº«åº,让ç¨åºä¹è½è·å¨Androidä¸,æ¯å¦PHP:
ä¹å°±æ¯ä½ æåºé¾æ¥å¨ld-linux-armhf.so.3åPHPä¾èµçåºé½æ¾å°/data/local/tmp/web/libé,ç¶å设置个å«å,å°±è½å¨Androidçadbshelléè¿è¡æ èæ´¾çPHPäº.
å½ç¶,ä½ ä¹å¯ä»¥ç¨patchelf设置PHPçinterpreterårpath,ææå·®ä¸å¤:
ææ ·äº¤åç¼è¯ä¸ä¸ªQTåºç¨ç¨åºï¼
1.设置ç¯å¢åéï¼rPATHï¼æ·»å 为交åç¯å¢ä¸ç¼è¯åçæçqmakeè·¯å¾ï¼é常å主æºçç³»ç»æ¯ä¸ç§æ¶æï¼åæ¶éè¦ç¡®ä¿äº¤ågccç¼è¯å¨å¨å¨PATHå®ä¹rQMAKESOECï¼äº¤åç¼è¯ç对象ççå¹³å°æè¿°æ件ï¼ä¾å¦makespec/qws/linux-arm-g++rQTDIR=Qtçå®è£ æ件ï¼åæ¾è¿åºå头æ件rLD_LIBRARY_PATH=åæ¾çæ¯Qtç交åç¼è¯åçåºï¼åå¤ä¸ºç®æ ç¼è¯é¾æ¥çåºr2ãæ§è¡ç¯å¢åéré常æ们é½ä¼å°ä»¥ä¸ç设置æ¾ç½®å¨ä¸ä¸ªbashèæ¬ä¸ï¼éè¦çæ¶åå°±æ§è¡ä¸ä¸ãå¼å§ç¼è¯r1.使ç¨qmakeï¼projectæ¥çæ项ç®æ件****.pror2使ç¨qmakeæ¥çæMakefileæ件r3使ç¨makeæ¥ç¼è¯ç§»æ¤ï¼ä½¿ç¨readeifå·¥å ·æ¥åæç®æ ç³»ç»ç以æ¥åºï¼ç¶åcopyç¸å ³çåºå°ç®æ æ件系ç»å ãé常æ们ä¹æ¯éåèæ¬çæ¹å¼æ¥å®æãrä¸è¬èè¨ï¼å¡æ¯æè§å¾çæè éå¤æ§çå·¥ä½ï¼æ们é½å¯ä»¥éåèæ¬çæ¹å¼æ¥è§£å³ã