Build app for yocto 2.1 with Qt 5.6



  • Hi,
    I build console Qt simple to printf "Hello" but it error.

    18:52:07: Running steps for project untitled4...
    18:52:07: Configuration unchanged, skipping qmake step.
    18:52:07: Starting: "/usr/bin/make" 
    g++  -o untitled4 main.o   -lQt5Core -lpthread 
    /usr/bin/ld: cannot find -lQt5Core
    Makefile:201: recipe for target 'untitled4' failed
    collect2: error: ld returned 1 exit status
    make: *** [untitled4] Error 1
    18:52:07: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled4 (kit: Beaglebone)
    When executing step "Make"
    18:52:07: Elapsed time: 00:00.
    

    So i add QMAKE_LFLAGS=--sysroot=/opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi on my pro file app, till error

    18:53:40: Running steps for project untitled4...
    18:53:40: Configuration unchanged, skipping qmake step.
    18:53:40: Starting: "/usr/bin/make" 
    g++ --sysroot=/opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi -o untitled4 main.o   -lQt5Core -lpthread 
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/../lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: cannot find -lQt5Core
    Makefile:201: recipe for target 'untitled4' failed
    collect2: error: ld returned 1 exit status
    make: *** [untitled4] Error 1
    18:53:40: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled4 (kit: Beaglebone)
    When executing step "Make"
    18:53:40: Elapsed time: 00:00.
    

    Please, help me out. Thanks !


  • Lifetime Qt Champion

    Hi,

    It looks like you are building with a desktop compiler while trying to link with your yocto based Qt.

    Are you sure your kit is setup correctly ?



  • Hi, thanks for rep.
    I am sure my kit is correct. !

    This is my configure.

    QtCreator configuration

    I did update qtcreator.sh to set the env variable required for cross compilation
    Sysyroot: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux@
    Compiler: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ @
    QtVersion: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake@(qt 5.6.2).
    Debug: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb@


  • Lifetime Qt Champion

    Does it work properly if you do it from the command line ?



  • @SGaist
    Thanks for rep !
    When i try run @qmake -project@ on terminal, i dont see everything. So i @ctl + c@ to end this command


  • Lifetime Qt Champion

    Except that by calling just qmake like that you are likely calling your distribution installed and not your poky built qmake. You should use the full path to ensure which one is used.



  • Thanks for rep !

    I go to qmake path in /opt/poky/2.1.1/.../qt5/qmake but like the same, the command run but dont see notthing, It like i run a qt app on terrminal and end it using @crl+C@


  • Lifetime Qt Champion

    What do you mean by I don't see nothing ? Did you call make after calling qmake ?



  • Hi SGaist, thanks for rep.
    Now I can build console Qt app and run it on my beaglebone, but when i build Qt Gui app using terminal and run on my bbb, the error @QXcbConnection: Could not connect to display
    Aborted@.

    I google and trying @export DISPLAY:=0@ but dont work.


  • Lifetime Qt Champion

    Silly question but do you have an X server running on your BBB ?



  • Hi,
    I dont have x server, i just build yocto for beagbone with the image qt5-image on meta-bbb on github. On local.conf i have add these package openssh with dropbear.


  • Moderators

    @Fanning Without X server or frame-buffer you cannot execute GUI applications at all (not only Qt applications).


  • Lifetime Qt Champion

    If you want a GUI but don't have an X server for whatever reason, you should build one of the other backends of Qt.



  • Hi @jsulm , @SGaist , thanks for rep !

    I google and found how to run my qt app gui, when i run like this @./hello -platform linuxfb@ my app run ok ! Now i can run my Gui app, so i know my yocto and sdk ok, but why i add sysroot and sdk into QtCrator dont work. I dont know i doing wrong or enviroment variable misssing ?
    I have a question, what exactly x server, frame-buffer in here ? Thanks !


  • Lifetime Qt Champion

    The frame buffer is the device that you write into to get something on the screen.

    For the X server see here.


  • Moderators

    @Fanning If you have problems with sysroot/SDK in QtCreator then you should say what problems exactly. Else it is not possible to help you.



  • Hi, @jsulm , my prolem on top. !

    Hi,
    I build console Qt simple to printf "Hello" but it error.

    18:52:07: Running steps for project untitled4...
    18:52:07: Configuration unchanged, skipping qmake step.
    18:52:07: Starting: "/usr/bin/make"
    g++ -o untitled4 main.o -lQt5Core -lpthread
    /usr/bin/ld: cannot find -lQt5Core
    Makefile:201: recipe for target 'untitled4' failed
    collect2: error: ld returned 1 exit status
    make: *** [untitled4] Error 1
    18:52:07: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled4 (kit: Beaglebone)
    When executing step "Make"
    18:52:07: Elapsed time: 00:00.

    So i add QMAKE_LFLAGS=--sysroot=/opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi on my pro file app, till error

    18:53:40: Running steps for project untitled4...
    18:53:40: Configuration unchanged, skipping qmake step.
    18:53:40: Starting: "/usr/bin/make"
    g++ --sysroot=/opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi -o untitled4 main.o -lQt5Core -lpthread
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/../lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: skipping incompatible /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
    /usr/bin/ld: cannot find -lQt5Core
    Makefile:201: recipe for target 'untitled4' failed
    collect2: error: ld returned 1 exit status
    make: *** [untitled4] Error 1
    18:53:40: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled4 (kit: Beaglebone)
    When executing step "Make"
    18:53:40: Elapsed time: 00:00.


  • Moderators

    @Fanning You're not using your ARM compiler.
    g++ -o untitled4 main.o -lQt5Core -lpthread
    g++ is your host compiler.
    Check the Kit you're using - especially the compiler.



  • Hi @SGaist and @jsulm

    I am facing a similar problem.

    I've setup my Kit like this:
    0_1479386305532_upload-ac729de1-f0cb-4e93-ba3f-9052cc8b8fa1

    0_1479386337351_upload-c1ac4c0a-7203-4520-b15d-a5a62393a279 file:///home/lcmscheid/Documents/yocto/Selection_005.png

    0_1479386359735_upload-88a0bf12-3286-443f-8ad8-84e3a7fb5fe7 file:///home/lcmscheid/Documents/yocto/Selection_006.png

    0_1479386374891_upload-ada78920-769a-47c5-85be-ec1e1e61fb4f file:///home/lcmscheid/Documents/yocto/Selection_007.png

    So, when I build the program, I have the error. Seems that it is running the host g++ compiler and not the one that has been set in the kit. How could I fix this?

    Thanks.



  • The compiler output :

    0_1479386583125_upload-6a299a7e-c86c-441d-b6fa-91f4d5af9a6b file:///home/lcmscheid/Documents/yocto/Selection_008.png


  • Moderators

    @lcmscheid Please upload the picture to some web space and post links here. Attaching pictures here usually doesn't work.


Log in to reply
 

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