Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Cannot find libs for cross-compiling (BBB) while Host PC works fine
Forum Updated to NodeBB v4.3 + New Features

[Solved] Cannot find libs for cross-compiling (BBB) while Host PC works fine

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 4.0k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    Bartholomew
    wrote on last edited by
    #1

    Hi all,

    this example with projectfile does nothing and works fine on my Host PC (Linux Host 3.13.0-37-generic x86_64 GNU/Linux):

    @#-------------------------------------------------

    Project created by QtCreator 2014-10-13T18:43:25

    #-------------------------------------------------

    QT += core
    QT -= gui

    TARGET = Marker-Test
    target.files = Marker-Test
    target.path = /home/ubuntu/workspace/temp
    INSTALLS += target

    TARGET = Marker-Test
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp \

    INCLUDEPATH += /usr/local/opencv-2.4.9/include
    /usr/include/c++/4.8/

    #just an example lib!
    LIBS += -L/usr/lib -lgs@

    This example works finde on my Host. If i compile and run it on my Host PC for my BeagleboneBlack, sometimes there is an error but not allways:

    1. error: cannot find -lgs (depends on the libs)
    2. error: collect2: error: ld returned 1 exit status

    How can i solve this problem? If i do not include any lib it works fine on my BBB.

    Thanks
    Bart

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

      Hi,

      Do you have all of these libraries available on the BBB sysroot your are using to build your applications ?

      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
      • B Offline
        B Offline
        Bartholomew
        wrote on last edited by
        #3

        Hi,

        on my Host PC:

        1. I installed Qt with the Online Installer
        2. I downloaded qt-everywhere-opensource-src-5.2.1
          2.1 @./configure -v -opensource -confirm-license -prefix /opt/Qt/5.2.1-BBB -xplatform linux-arm-gnueabihf-g++ -device linux-beagleboneblack-g++ -device-option CROSS_COMPILE=/usr/local/linaro/bin/arm-linux-gnueabihf-@
          2.2 make
          2.3 make install
          2.4 I copied the folder to my BBB => /usr/5.2.1-BBB
          2.5 added the PATH in /etc/environment
        3. added on my Host in Qt the "Kits" and "Devices"

        everything works fine and I can develop little progs (read values from IC2 and so on)

        Now I compiled openCV on my Host for the Host and everything works very well (detect something...)

        On my BBB:

        1. I downloaded openCV according to this manual: "http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html":http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html
        2. I got these error(s) from first post
        3. I tried to include any lib that exists on my BBB to, like: -L/usr/lib -lgs

        The problem I think is not openCV. The problems are in general.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Bartholomew
          wrote on last edited by
          #4

          I got the correct linking for INCLUDEPATH and LIBS

          but the error is still there:
          /usr/local/opencv-2.4.9/lib/libopencv_calib3d.so:-1: error: file not recognized: File format not recognized
          error: collect2: error: ld returned 1 exit status

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

            You are giving the wrong paths to the libraries. You can't use your host libraries to link to your cross-compiled software.

            Where are the arm version located ?

            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
            • B Offline
              B Offline
              Bartholomew
              wrote on last edited by
              #6

              Yes thanks now I know that this was my problem.
              I cross-compiled openCV with the arm-gnueabi.toolchain.cmake from ~/opencv-2.4.9/platforms/linux and it worked very well.

              Now I did the same with ArUco (this was my original problem) with:

              @cmake -DCMAKE_TOOLCHAIN_FILE=/home/basti/Downloads/aruco-1.2.5/linux/arm-gnueabi.toolchain.cmake -DCMAKE_PREFIX_PATH=/usr/local/opencv-2.4.9-hardfp /home/basti/Downloads/aruco-1.2.5@
              @sudo make -j4@

              and I get this error:
              @make[2]: *** No rule to make target /home/basti/Downloads/opencv-2.4.9/platforms/linux/build_hardfp/lib/libopencv_videostab.so.2.4.9', needed by src/libaruco.so.1.2.5'. Stop.
              make[2]: *** Waiting for unfinished jobs....
              [ 45%] Building CXX object src/CMakeFiles/aruco.dir/cameraparameters.cpp.o
              make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
              make: *** [all] Error 2@

              Do you know what I am doing wrong?

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

                Are you sure the prefix path is correct ?

                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
                • B Offline
                  B Offline
                  Bartholomew
                  wrote on last edited by
                  #8

                  The prefix path from aruco was correct. The install prefix from opencv was wrong.

                  1 Reply Last reply
                  0

                  • Login

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