日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

嵌入式linux安装qt,树莓派上安装qt

發布時間:2025/3/12 linux 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 嵌入式linux安装qt,树莓派上安装qt 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在樹莓派上安裝了官方的raspbian系統。為了在能在上面開發程序,在系統上安裝了qt4 。參考鏈接http://qt-project.org/wiki/apt-get_Qt4_on_the_Raspberry_Pi

apt-get

Firstly I got the development tools needed by Qt Creator in the hope it would be less heavy for the Pi to download separately.

sudo apt-get install qt4-dev-tools

Then I went for Qt Creator

sudo apt-get install Qtcreator

I also installed

sudo apt-get install gcc

sudo apt-get install xterm

sudo apt-get install git-core

sudo apt-get install subversion

this gives as a result Qt Creator 2.5 with Qt 4.8.1 32 bit

Problem : no toolchain.

We can only compile for remote embedded devices and this is not the case here, because we are on the Pi and not remotely accessing it.

I added a gcc toolchain

Options > build & run > tab tool chain > button add

Choose?GCC

Then set compiler path : /usr/bin/arm-linux-gnueabihf-gcc-4.6

Debugger : /usr/bin/gdb

Mkspec : default

Qt Creator seems to detect that we are going to deploy on a remote target.

To fix this :

Go to menu help > about plugins

Uncheck device support > remote linux

Restart Qt Creator

Go to tools > options?TAB?> build & run > Qt versions > add “/usr/bin/qmake-qt4”

It will then show up as a desktop project in the project wizard instead of embedded.

下載的raspbian系統比較新,里頭已經內置了GCC,跟著網站的步驟走,很容易就能完成QT4的安裝。注意sudo apt-get install Qtcreator中Qtcreator首字母要小寫,要不然樹莓派的服務器會找不到安裝程序提示錯誤。

以前在做linux QT開發中 喜歡直接在window上用UE進行編輯,然后ftp到虛擬機中。同樣可以用這種方式對樹莓派進行qt的開發。在我下的raspbian中沒有安裝ftp。

第一步 通過云安裝,sudo apt-get install vsftpd。

第二步 對ftp進行配置,sudo vim /etc/vsftpd.conf。anonymous_enable=NO,local_enable=YES,write_enable=YES,local_umask=022。

第三步 重啟ftp服務 sudo service vsftpd restart

這樣就能在UE上編寫qt程序了。不過程序在樹莓派上直接編譯還是比較慢的,建議還是使用交叉編譯的方式。

PS:安裝qt需要比較大的空間,建議使用4G以上的SD卡,并且在raspi-config中Expand Filesystem使系統使用整張SD卡的大小,要不然只會分配2G多供系統使用。

總結

以上是生活随笔為你收集整理的嵌入式linux安装qt,树莓派上安装qt的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。