5

How do I compile an app I made in Qt Creator to my Raspberry Pi?

Here's my current setup: Qt Creator 2.4.1 running on Windows 7. I'm using MinGW for windows development, and Yagarto is installed as the Linux cross-compiler. Under the Qt Creator options, under Linux Devices, I have set up the Pi (at this point, Qt Creator sees the Pi with no problems when I press Test).

Here's my problem: I don't know how to get the Pi as a build target. I believe I have to set up the cross-compiler under Build & Run -> Tools. I've manually added the Yagarto executable here, but that hasn't gotten me a build target, or allowed me to compile anything for the Pi.

The documentation for Qt hasn't helped me, and the majority of what I find online about compiling for the Pi, or about deploying to general Linux systems, deploying from Linux to Linux, or from Linux to Windows. What I need is Windows to Linux.

Notes: I'm not married to any particular compiler or tool-chain, so feel free to give me your recommendations. Also, I'm a complete beginner (and with Linux, I'm less than a beginner). Really I'm just hacking around, trying to familiarize myself with the Pi/Linux, and developing for it. One thing I've read is "set up a virtual machine and develop on Linux," but I'd like to avoid that if possible.

Thanks in advance.

EDIT: NEW INFORMATION

After doing some research, I now realize that I need to compile Qt from source for the Linux/ARM architecture before I do anything else.

I found this question on StackOverflow, which led me to this blog post. Following these instructions has enabled me to use 'configure' to create the makefile with no problems. However, when I use jom to build qt, it builds for about 5 minutes, and then exits with the following errors at the command line:

jom: C:\qt-pi\src\coreLib\Makefile [..\..\lib\libQtCore4.dll] Error 1
jom: C:\qt-pi\src\coreLib\Makefile [all] Error 2
jom: C:\qt-pi\Makefile [sub-sorelib-make_default-ordered] Error 2
jom: C:\qt-pi\Makefile [all] Error 2

Anybody have any ideas?

I'm using MSVC2010 as the host compiler, building for arm-none-linux-gnueabi-g++. Sourcery Codebench Lite is installed as the cross compiler. Perl is installed. Finally, I do run the vcvarsall.bat file from the MSVC2010 directory before I do anything.

EDIT: REALIZATION

I just realized that where I'm at now with this is probably more appropriate for StackOverflow than here, so I've posed this question on that side. If anyone reading this has any ideas, though, please post your answers here. Also, if I ever figure this out, I'll post the solution here, too.

5
  • Are you getting an error from the compiler? This isn't really enough to go on.
    – Jivings
    Aug 26, 2012 at 10:47
  • @Jivings After trying to set this all up, I don't even have "Linux device" as a build target. Given that I can see the Pi when I press "test" under "Linux devices" in the options of Qt creator, I'm wondering what else I need to set up or do.
    – ahuth
    Aug 26, 2012 at 11:14
  • Edited my original post to make the question and circumstances more clear.
    – ahuth
    Aug 26, 2012 at 22:37
  • 1
    Just a little hint, when you are building an application for Linux, it is a LOT more helpful to be running Linux for your build environment. One obvious example is @Keyz182's answer, which is Linux-specific. The other is that, to my knowledge, gcc and the other GNU tools are not available natively on Windows. Instead, you have to resort to using either an IDE or a workaround such as Cygwin or MinGW.
    – fouric
    Jan 23, 2013 at 0:08
  • @InkBlend You're right on the money. My problem is, I'm almost completely unfamiliar with using Linux, or having to build complex projects (make files confuse the crap out of me). But I guess that's why we do these things - to learn.
    – ahuth
    Jan 24, 2013 at 2:54

1 Answer 1

3

It might be worth checking in with the QTonPi guys. There's a link to the mailing lists and the IRC channel there.

On linux, you have to configure qtbase appending the following to ./configure

-opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$CC/bin/arm-linux-gnueabihf

Then, once qtbase is built and you have the new qmake, you use that to compile the rest of qt (or at least the modules you need). There's a beginners guide here that goes through it, along with a scripted version I wrote. You may be able to get some hints from there as to what to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.