QT5, Ubuntu 13.10, Angstrom Beaglebone, and a Windows programmer asking for help



  • Hello. I'm Italian (so pardon my poor english).
    I'll give you the most infos i can before asking the real question 'cause i'm not able to evaluate what are important and what not. Please be patient with a Linux noob.

    I'm a Windows programmer. I worked for about 15 years with VB6 and C++Builder. I also have programmed some microprocessor, like some Atmel, Rabbit boards or Motorola DSPs. These all are "closed IDEs"... i mean that i never had to worry about compilers, toolchains, and such: i write my code, it compiles, and it runs. Also I never had the need to work with Linux, but now i have to re-build an app made for Windows to run on an embedded system with a touchscreen.
    While we're still evaluating what hardware to use for the next 15 years, we bought a Beaglebone Black to get the hang of it and start to learn.
    What i would like to obtain is to develop in Windows, debug the most there, then compile for the Beaglebone and finish the debugging.

    So i installed QT in a fresh Win7/64 PC, installed Virtualbox, and then a virtual Ubuntu machine, on which i installed QT.
    Right now, i'm able to compile and run in Ubuntu what i've developed on Windows.

    But now i have to compile for the Beaglebone. I tried to follow the instructions i've found "here":https://qt-project.org/forums/viewthread/21082/ or "here":http://qt-project.org/forums/viewthread/27076 but i'm not able to obtain anything, mostly 'cause that answer requires a knownledge of Linux that i still have to build up. To give you an idea, it took me about two hours before being able to copy the toolchains mentioned in that thread in the right folder (./usr/) 'cause the permissions, the command options, etc.
    Also, that guides refer to older versions of QT, and seems to me that something is different....

    So, what i'm asking for is a step-by-step guide to make me able to compile in Ubuntu a QT app for the Beaglebone.
    Any added explanation about what i'm required to do is more than welcome but i'd like to learn by making and typing.
    There's anyone so kind to take my hand and point me in the right direction? (or just to kick my fat bottom, if this makes me going forward :) )

    Thanks and sorry for the long post: i wanted to be the more clear possible.



  • I believe that "this tutorial":http://qt-project.org/wiki/RaspberryPi_Beginners_guide will help you.
    But you should change all the device depending options to your one.
    For example in the tutorial was used "-device linux-rasp-pi-g++" you should change it to "-device linux-beagleboard-g++" or something like this.
    I'm not sure that the Beaglebone is the same as the Beagleboard, but it is the closest name in qtbase\mkspecs\devices folder.

    It's better to ask a more concrete questions about existing tutorials rather than ask to write a new one for the special device.



  • I've also found three nice video tutorials special for your device:
    http://www.youtube.com/watch?v=yXTJC-_rlMY
    http://www.youtube.com/watch?v=yNvOyY9zK1o
    http://www.youtube.com/watch?v=kP7uvOu9hoQ

    They are look very detailed.

    I hope it will help you.



  • Thanks
    I saw these videos .... but is'nt he installing QT IN the beaglebone? I just need to crosscompile FOR it from Ubuntu (as it seems that it can't be done from Windows).

    About the tutorial you linked: i saw it but abandoned it when it says "Pro tip: don’t build your own cross-compiler...." .... i understand that i HAVE to do it... right?

    So, a concrete question:
    what are the QT5 sources i have to download? There's a lot of stuffs in the download page...
    And when i got them, where should i uncompress them?

    Thanks



  • I've never perform compilation for embedded Linux, but I have an experience in cross compilation for Android from Windows and Linux. All cross compilations are very similar and have the same principles.

    To make a cross compilation (for example from Windows to Android) you need a special toolchain and a make program. For Android such a toolchain provides the Android NDK. And the make program can be MinGW (for Windows) or GNU make (for Linux).
    A toolchain is a set of libraries, programs and headers for a concrete platform. It should be provided by the OS manufacturer.
    The make program uses the toolchain to create binaries according to Makefile.
    Makefile can be written manually, but almost every time you have a special makefile generator (configure) or you have already prepared Makefile.

    And now the answer for your question:
    All the stuff on the Qt download page is already prepared binaries for a concrete platform. It doesn't contains the binaries for your target platform, so you shouldn't use them. But you can create such binaries by yourself from the Qt source codes. You need to decide what host platform you will be use for the cross compilation. If Windows - use "Windows Qt sources":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.zip.mirrorlist if Linux - "Linux Qt sources":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz



  • [quote author="ZeAL0T" date="1383164330"]You need to decide what host platform you will be use for the cross compilation. If Windows - use "Windows Qt sources":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.zip.mirrorlist if Linux - "Linux Qt sources":http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gz[/quote]
    Uh.... after a week of googling and reading i was thinking that cross-compiling in Windows for any Linux target was'nt possible (i remember an accepted answer on stackoverflow.com saying exactly this).
    Are you telling me instead that i should be able to do it?
    'cause that could so much simpler, as i could not need the Ubuntu virtual machine, then (and being very fond in windows, i have no problem at setting and configuring stuffs).

    [quote author="ZeAL0T" date="1383164330"]
    A toolchain is a set of libraries, programs and headers for a concrete platform. It should be provided by the OS manufacturer.
    The make program uses the toolchain to create binaries according to Makefile.
    Makefile can be written manually, but almost every time you have a special makefile generator (configure) or you have already prepared Makefile.
    [/quote]
    Well, it's more clear now. Thanks.
    BUT:
    where i get lost is when i have to get those toolchains.
    The linux world seems to my eyes like a very big city, where the inhabitants know everything about it and when you ask for a direction give you infos that requires an already build knowledge.... which i have not.

    I mean: you kindly pointed me to a thread about the Raspberry, thinking that it should enlight me... when i'm there i'm pointed to download stuffs that i think are not what i need, and then a lot of things to do that i don't get.
    (I hope to be clear: i'm not complaining, but just telling why i feel lost despite your help).

    So, "this":https://qt-project.org/forums/viewthread/21082/ post goes to the angstrom site to get the toolchains, "this one":https://qt-project.org/forums/viewthread/33765/ goes to get some "linaro" toolchains....
    What's the differences? why one instead of another?



  • [quote author="Parduz" date="1383212241"]
    Uh.... after a week of googling and reading i was thinking that cross-compiling in Windows for any Linux target was'nt possible (i remember an accepted answer on stackoverflow.com saying exactly this).
    [/quote]

    You can perform a cross compilation under Windows as well as under Linux. You can create a binaries for any platform under any platform. The main problem only with configuring cross compiling tools. Under Windows this can be more complicated than under Linux. And usually Windows have less tutorials or support in this field because not many people choose this way.



  • If you didn't find the exact tutorial for your concrete device, you have to perform all the configuring by yourself. And it won't be very fast.

    I can told you that my first cross compile configuring took me several days. It was like investigation. The main problem that if you choose some not very popular field not many people can help you.

    For example, I found that Qt for Android uses float for qreal. But I had to use double precision for my project. I've tried to find answer for several days in the internet but didn't get something concrete. Then I start to inspect source codes and found how to change qreal to double for Android. The next problem was a bug in Qt for Android when qreal is double. Again I've tried to search without a result. Fixed it by myself and reported to Qt JIRA. And so on.

    I've started from windows but faced with some problems and moved to Linux as at has more tutorials. After some time I understood the principles and turned back to Windows.

    While exploring this area you will be despaired many times and will even decide that it's impossible, but the result will bring you so much self-satisfaction that you forget all the difficulties.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.