Raspberry Pi, correctly linking to the libaries



  • Hello everyone,

    I've been trying for a while now to cross compile for my raspberry pi - model 2 and failed.

    So I finally decided to install a boot pation of linux, so I can try following this tutorial

    http://wiki.qt.io/RaspberryPi2EGLFS

    It's great, much more indepth and noob-friendly than any other I found online.

    And, to my surprise I'm further along than ever. In fact I'm all the way down to point 14, running the example on the raspberry Pi,

    but here I've encountered a problem.

    Something seems to have gone wrong with the linking:

    I ave this error messages when I try to run the program:

    • /home/pi/qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5: no version information available (required by /home/pi/qopenglwidget)
    • /home/pi/qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /home/pi/qopenglwidget)
    • /home/pi/qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5: no version information available (required by /home/pi/qopenglwidget)
      +/home/pi/qopenglwidget: relocation error: /home/pi/qopenglwidget: symbol_ZN14QSurfaceFormat16setDefaultFormatERKS_, version Qt_5 not defined in file libQt5Gui.so.5 with link time reference

    This tells me at least, that creating the libs, crosscompiling and coping everything into the pi was succesfull.
    Thats waaay further than I ever came before, and it does find the libaries, but can't identify them ?

    But I'm at a loss what to do,
    checking the file properties of libQt5Gui.so tells me target file libQt5Gui.so.5.9.4
    thats the version I selected for sources and tried to create the libs from

    This are my first steps in Linux/Pi development, so my ideas on how to proceed are exhausted, any help is appreciated


  • Qt Champions 2017

    Hi
    I also tried and got stopped in the wonderful world of cross compiling.
    So if goal is just to fool around with the pi and Qt then this might be of interest.
    http://www.qtrpi.com/home



  • @J-Hilk you may want to take a look at this post, although not stopped at item 14 it seems to have succeeded and may shed some light with your issue.



  • hi @mrjj , thanks for the feedback
    Yeah crosscompiling, super fun x)

    Ever since I saw this video
    https://www.youtube.com/watch?v=QFWPw4UWL9E

    I had the idea of doing someting with Qt and Raspberry Pi. Now I have actually a vision/idea what i want to archive and I have the needed hardware on a shopping list ready to be bought, just need to get started on the software side.

    Sadly, evenso I asked the sales team multiple times, there seems to be no middle ground between a 30 day trial and a full purchase of commercial Embedded version with a monthly cost of 500$ -_-

    So I'm stuck with the opensource variant

    I knew of qtrpi but I haven't tried it yet, It requieres a linux distribution. That one, I now have at least ready, but it has not beedn updated in a while and is therefore limited to qt5.6 and 5.7. And with 5.7 I had some bad expierence, I would like to never go back to that version x)

    But if this doesn't work out, it's most likely the next step I'll try.

    @Pablo-J-Rogina
    thanks for the thread link, I doubt it will help specifically, as I have qt base, and I have the generated base lib, that I copied onto the pi. But at the very least I could try a different version of Qt-sources, 5.9.5 for example was released a day after I compiled 5.9.4, or, like the person in the thread, I can try 5.10

    But it would require a remake of the Pi and a thoroughly cleaning of my Linuxs distribution/or a reinstall as well.

    Recompiling qt from source will also take, again, serveral hours x), so I'll mark it on my check list on what to do, but for a bit later.

    Meanwhile I keep googling, I guess.

    Edit:
    just noticed, I'm not running stretch as os on the pi, like the tutorial said it was tested with. So, seems like I'll go with a complete redo anyway.



  • So, I installed Raspbian stretch, followed the example but this time I try it with version 10.1

    same place, different error message.

    When I try to start the qopenglwidget example app, I get

    • this application failed to start because it could not find or load the qt platform plugin "xcb" in "".
      Available Platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

    Seems like it is looking in the wrong place ? xcb is clearly there, its listed as possible platform plugins.


  • Qt Champions 2017

    hi
    and you did make normal deployment folder with sub folder platforms with the plugins?



  • @mrjj
    Hi,

    On I did not. Thi Wiki-article/tutorial makes no mention of it.

    1. Update the device to let the linker find the the qt libs:
      echo /usr/local/qt5pi/lib | sudo tee/etc/ld.so.conf.d/qt5pi.conf
      sudo ldconfig
      If you‘re facing issues with running the example try to use 00-qt5pi.conf instead of qt5pi.conf, to introduce proper order

    And yes I tried both conf‘s😔

    I tried a strace on the executable, and it confuses me Even more. It says that it finds the lib at the correct place.

    I‘ll try to post a Screenshot
    alt text

    ps: no 4k img upload, ppf please


  • Qt Champions 2017

    @J.Hilk said in Raspberry Pi, correctly linking to the libaries:

    conf

    Ah well, if you use .conf to point it the locations, i assume the normal
    folder structure no longer applies.
    but for the [Platforms] sections, docs sems not to mention
    pointing it to other location ?
    http://doc.qt.io/qt-5/qt-conf.html

    The reason im asking is that first time i ever ran a standalone Qt program
    (on linux box) i got that error "qt platform plugin "xcb" in ""."
    since i didn't have the platforms subfolder but im just speculating.
    http://www.tripleboot.org/?p=138

    You deployment seems more embedded so its most likely something different.
    Also it seems you have the xcb in a platform folder but its under plugins but that
    might just be normal with a .conf setup.
    Is the "exe" in qt5pi or where is that located ?



  • @mrjj
    I decided to skip the tutorial at this point. At the end of the line I wanted to cross-compile from QtCreator anyway.

    I have working Qtlibaries, a valid qmake, so why not arrange a QtRaspberry - kit?

    I followed the 2nd tutorial from qtrpi, you linked earlier, that tackels that topic,
    and lo and behold, everything works 🙄

    Except fonts aparently. I get the error message that fonts are no longer shiped with qt.
    It doesn't matter anyway for my purpose, because my programm will not have a ui to begin with.

    It's supposed to controll input/output and interact via TCP/UDP with a remote app.

    Thanks for your help. A viable lesson learend. Don't be fixated on tutorials. Take what works and go your own way x)


Log in to reply
 

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