Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Apt-get Qt4 on the Raspberry Pi: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Add to category: Raspberry Pi)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Tutorial : apt-get install Qt4 on the Rasperry Pi=
[[Category:HowTo]]
[[Category:Raspberry Pi]]
;apt-get install Qt4 on the Rasperry Pi:Using the Raspbian image


Using the Raspbian image
== apt-get ==


==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.
<code lang="bash">sudo apt-get install qt4-dev-tools</code>


Firstly I got the development tools needed by Qt Creator in the hope it would be less heavy for the Pi to download separately.<br />
Then I went for Qt Creator
<code lang="bash">sudo apt-get install qtcreator</code>


Then I went for Qt Creator<br />
I also installed
<code lang="bash">sudo apt-get install gcc
sudo apt-get install xterm
sudo apt-get install git-core
sudo apt-get install subversion</code>


I also installed<br /> this gives as a result Qt Creator 2.5 with Qt 4.8.1 32 bit
this gives as a result Qt Creator 2.5 with Qt 4.8.1 32 bit


==Problem : no toolchain.==
== 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.
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===
=== I added a gcc toolchain ===
 
Tools/Options &gt; build &amp; run &gt; tab tool chains &gt; button add<br /> Choose <span class="caps">GCC</span>


Tools/Options > build & run > tab tool chains > button add
Choose GCC
* Then set compiler path : /usr/bin/arm-linux-gnueabihf-gcc-4.6
* Then set compiler path : /usr/bin/arm-linux-gnueabihf-gcc-4.6
* Debugger : /usr/bin/gdb
* Debugger : /usr/bin/gdb
* Mkspec : default
* Mkspec : default


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


To fix this :
To fix this :
 
* Go to menu help > about plugins
* Go to menu help &gt; about plugins
* Uncheck device support > remote linux
* Uncheck device support &gt; remote linux
* Restart Qt Creator
* Restart Qt Creator
* Go to tools &gt; options <span class="caps">TAB</span> &gt; build &amp; run &gt; Qt versions &gt; add /usr/bin/qmake-qt4”
* 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.
It will then show up as a desktop project in the project wizard instead of embedded.

Latest revision as of 15:30, 23 November 2016

apt-get install Qt4 on the Rasperry Pi
Using the Raspbian image

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

Tools/Options > build & run > tab tool chains > 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.