Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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 is 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, is about 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.

share|improve this question
    
Are you getting an error from the compiler? This isn't really enough to go on. –  Jivings Aug 26 '12 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 '12 at 11:14
    
Edited my original post to make the question and circumstances more clear. –  ahuth Aug 26 '12 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. –  InkBlend Jan 23 '13 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 '13 at 2:54
add comment

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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