Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cross compile for raspi outputs an "incompatible" error.

Cross compile for raspi outputs an "incompatible" error.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
13 Posts 3 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    doodle
    wrote on last edited by
    #1

    I have used the yocto to make a SDK to develop my raspi2. I have followed the qt wiki to configure the Qt creator. If I compile the example by sourcing the Qt cross-build environment, everything is OK.
    But when I use the configured Qt creator to build it, the "incompatible" error comes out.Here is the error message:

    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /home/max/project/poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/lib/libQt5Widgets.so when searching for -lQt5Widgets
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lQt5Widgets
    

    I found that Qt creator use my system's ld, how to change it to the SDK's ld.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you make a Kit with the Qt version you cross-compiled ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        doodle
        wrote on last edited by doodle
        #3

        Yes, kit's setting is here:
        alt text

        jsulmJ 1 Reply Last reply
        0
        • D doodle

          Yes, kit's setting is here:
          alt text

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @doodle Please upload the image to sharing service and post the link here: the image is not visible.
          The error message you posted says that you're using your host x86_64 tool chain (compiler/linker) instead of the tool chain for raspi. Most probably your Kit is configured wrongly - check the selected compiler there.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • jsulmJ jsulm

            @doodle Please upload the image to sharing service and post the link here: the image is not visible.
            The error message you posted says that you're using your host x86_64 tool chain (compiler/linker) instead of the tool chain for raspi. Most probably your Kit is configured wrongly - check the selected compiler there.

            D Offline
            D Offline
            doodle
            wrote on last edited by
            #5

            @jsulm Hi
            I use the cross compiler built by yocto, Qt creator configuration is here:
            alt text
            and there is no linker option in the Qt creator.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              doodle
              wrote on last edited by
              #6

              I change the makefile's CXX and LINK manually to the sdk's cross compiler, and set some flags, everything is OK. So now my question is how to set these things correctly with the Qt creator.
              BTW, as you can see above, I've configure the right compiler and use the right kits for the project, but things go wrong.

              jsulmJ 2 Replies Last reply
              0
              • D doodle

                I change the makefile's CXX and LINK manually to the sdk's cross compiler, and set some flags, everything is OK. So now my question is how to set these things correctly with the Qt creator.
                BTW, as you can see above, I've configure the right compiler and use the right kits for the project, but things go wrong.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @doodle Please show the "Kits" tab after selecting the correct Kit. Are you sure you selected the Kit in QtCreator to build the project? The Kit you're using for cross compilation must use that compiler.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                D 1 Reply Last reply
                0
                • D doodle

                  I change the makefile's CXX and LINK manually to the sdk's cross compiler, and set some flags, everything is OK. So now my question is how to set these things correctly with the Qt creator.
                  BTW, as you can see above, I've configure the right compiler and use the right kits for the project, but things go wrong.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @doodle One more note: you should select gcc not g++ as compiler.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @doodle Please show the "Kits" tab after selecting the correct Kit. Are you sure you selected the Kit in QtCreator to build the project? The Kit you're using for cross compilation must use that compiler.

                    D Offline
                    D Offline
                    doodle
                    wrote on last edited by
                    #9

                    @jsulm The yocto-gcc is g++,
                    alt text
                    I've also add
                    source /home/max/Desktop/project/poky-sdk/environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi
                    on the top of qrcreator.sh, still go wrong.

                    jsulmJ 1 Reply Last reply
                    0
                    • D doodle

                      @jsulm The yocto-gcc is g++,
                      alt text
                      I've also add
                      source /home/max/Desktop/project/poky-sdk/environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi
                      on the top of qrcreator.sh, still go wrong.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @doodle
                      Did you try to do delete the build folder, run qmake and do a complete rebuild?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      D 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @doodle
                        Did you try to do delete the build folder, run qmake and do a complete rebuild?

                        D Offline
                        D Offline
                        doodle
                        wrote on last edited by
                        #11

                        @jsulm Yes, I delete the whole build directory.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          doodle
                          wrote on last edited by
                          #12

                          The makefile is bit strange, the CC and CXXdon't change to the compiler I've set.

                          ####### Compiler, tools and options
                          
                          CC            = gcc
                          CXX           = g++
                          DEFINES       = -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
                          CFLAGS        = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES)
                          CXXFLAGS      = -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
                          INCPATH       = -I../window -I. -I../../poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5 -I../../poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I../../poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtGui -I../../poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -I../../poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++
                          QMAKE         = /home/max/project/poky-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
                          DEL_FILE      = rm -f
                          CHK_DIR_EXISTS= test -d
                          MKDIR         = mkdir -p
                          COPY          = cp -f
                          COPY_FILE     = cp -f
                          COPY_DIR      = cp -f -R
                          INSTALL_FILE  = install -m 644 -p
                          INSTALL_PROGRAM = install -m 755 -p
                          INSTALL_DIR   = cp -f -R
                          DEL_FILE      = rm -f
                          SYMLINK       = ln -f -s
                          DEL_DIR       = rmdir
                          MOVE          = mv -f
                          TAR           = tar -cf
                          COMPRESS      = gzip -9f
                          DISTNAME      = window1.0.0
                          DISTDIR = /home/max/project/qt5/build-window-yocto_raspi-Debug/.tmp/window1.0.0
                          LINK          = g++
                          LFLAGS        = 
                          LIBS          = $(SUBLIBS) -L/home/max/project/poky-sdk/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lpthread 
                          AR            = ar cqs
                          RANLIB        = 
                          SED           = sed
                          STRIP         = strip
                          
                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            doodle
                            wrote on last edited by
                            #13

                            OK, I finally find the problem, the default qmake mkspecs is linux-g++ which is totally wrong, so I manually change it to the ...../qt5/mkspecs/linux-oe-g++/ , now I build the project smoothly!
                            Maybe this mistake has somthing to do with the yocto's "meta-qt5" layer.

                            1 Reply Last reply
                            1

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved