Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 19
Registered: ‎03-04-2012
My Device: Playbook 2.0
My Carrier: Vodafone
Accepted Solution

Cross compiling Qt in windows?

Hi, 

 

I've succesfully installed Qt and the NDK in linux (a virtual machine actually), and I've already created a working application. The wiki says it is possible to crosscompile Qt for qnx in Windows (it is my main development plataform and copy the project every time I want to test in the playbook is a PITA :smileywink: ) but I can't do it because the compiler says a bunch of #define are missing and correcting them causes other errors. I've tried with cygwin and mingw with no luck.

 

Any insight? Has anyone able to do it? Any documentation I'm missing?

Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Cross compiling Qt in windows?

[ Edited ]

Seems there is something that needs fixing on Windows. Here's a recent Twitter conversation with a reply from Eduardo Pelegri, the open-source guy at RIM:

 

 
Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Cross compiling Qt in windows?

Since the Qt binaries (libraries) can be built on Linux and then transferred to Windows for linking/packaging into the app when it's built using the Windows NDK, why would you need to actually build Qt on Windows? You don't (shouldn't) have to regenerate the binaries that often, certainly not every time you rebuild your own app.

What am I missing here? I set up an Ubuntu VPS on Rackspace which I used to generate the Qt libraries for the ARM target, and I transfer the "stage" folder (what "make install" generates) to my Windows machine. Then I merrily rebuild my app many times as needed, all using the same static set of Qt binaries. When I want to synchronize to a newer version of Qt, I pop back into the VPS, rebuild, retransfer, and shut it down again for next time.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 19
Registered: ‎03-04-2012
My Device: Playbook 2.0
My Carrier: Vodafone

Re: Cross compiling Qt in windows?

I tried that in the beginning (using the precompiled libs in github) but somehow I couldn't compile the sample program, lots of dependencies missing, so I just assumed I needed to compile Qt from windows too. I'll give another try.

 

Thanks!

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Cross compiling Qt in windows?

What was missing? You do need to point the IDE (or your .pro or makefile) to the right places in the stage folder.

I was able to follow BGMot's excellent recipe (and the one key item about "-platform blackberry" mentioned in the first comment) without any real issue, using my own build. Haven't tried with the precompiled binaries yet, as I assumed they weren't likely to keep those completely up to date in these early days.

http://bgmotey.blogspot.com/2012/02/qthelloworld-in-momentics-ide-for.html

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Cross compiling Qt in windows?

The approach proposed by Peter  works 100% 

If you have errors just post them here -)

Developer
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB
My Carrier: sfr

Re: Cross compiling Qt in windows?

Hi all,

I would like to use the windows IDE only and already have the keys to sign binaries for real device deployments (got a 2.0 PB as well at hand).

 

So, could anyone try to share that famous /stage folder content (built on a shiny linux most of us do not have) ?

That would help us - windows only guys - to climb onto the train without struggling first with the unnecessary preliminary pain of builidng each our own QT "things".

We 'd better focus on writing apps using a shared and community (pre)built windows QT IDE.

 

Does anyone here agree with my proposition ?

 

Tks in advance. 

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Cross compiling Qt in windows?

iravelo, if you visit #qt-qnx on Freenode (IRC) you could likely find people who have recent builds available to share with you.

I'll start doing builds periodically and posting them for download if nobody else is going to, and if the load isn't too extreme...

I can also post instructions on setting up your own system and building them. It takes literally a few minutes to set up a Rackspace VPS to do this, for example (and a bit over an hour to build).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Cross compiling Qt in windows?

Actually @roquetto at KDAB has been putting up binaries every so often as they update the repository. The /topic in the #qt-qnx IRC channel has the link in case you lose track of it, but here it is: http://www.kdab.com/~rafael/playbook/

They may not be nightly builds, but given that things are evolving I don't think you necessarily want a nightly build but rather a recent and relatively known-good build. I assume that's what he's posting there.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 19
Registered: ‎03-04-2012
My Device: Playbook 2.0
My Carrier: Vodafone

Re: Cross compiling Qt in windows?

trying right now BGmot's zen :smileyhappy: