樹莓派中安裝QT


樹莓派中安裝QT

 

 

本文博客鏈接:http://blog.csdn.net/jdh99,作者:jdh,轉載請注明.

 

 

環境:

主機:WIN7

硬件:樹莓派

 

步驟:

參考鏈接:http://qt-project.org/wiki/apt-get_Qt4_on_the_Raspberry_Pi

 

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

  1. sudo apt -get install qt4-dev-tools

 

Then I went for Qt Creator

  1. sudo apt -get install Qtcreator

 

I also installed

  1. sudo apt -get install gcc
  2. sudo apt -get install xterm
  3. sudo apt -get install git-core
  4. sudo apt -get install subversion


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

 

如果出現問題:e: unable to locate package qt creator,則輸入以下命令更新

sudo apt-get update && sudo apt-get upgrade

 

如果還是有問題,嘗試sudo apt-get install qtcreator

成功后可以運行qtcreator:
此時還需要添加編譯鏈:

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.

配置好之后,嘗試運行一個簡單的程序,效果如下:
運行成功!不過編譯很緩慢,正式開發估計還是得在PC上開發好之后再進行移植.

 

http://blog.csdn.net/jdh99/article/details/8738890


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM