1. 程式人生 > >樹莓派中安裝QT

樹莓派中安裝QT

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

樹莓派中安裝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上開發好之後再進行移植.

           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述