Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cross compilation issues Qt + libmatrix_creator_hal



  • Hi,

    I'm trying to cross compile an application that use both Qt and matrix_creator_hal libs.

    My environment is:

    • Qt 5.12
    • host: Intel (x86_64) on Ubuntu 17.10
    • target: Raspberry Pi (armv7l) on Raspbian Stretch 9.6
    • IDE: Qt Creator 4.8

    I did setup my toolchain on Qt Creator along with a Kit with sysroot set.

    I can successfully cross compile Qt only apps but when I link to matrix_creator_hal lib I get theses errors during link:

    [...]/sysroot/usr/lib/libmatrix_creator_hal.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
    

    My pro file contain this line:

    LIBS += -lmatrix_creator_hal
    

    Any ideas how to fix this?

    Thanks


  • Qt Champions 2017

    @X-Krys said in Cross compilation issues Qt + libmatrix_creator_hal:

    I can successfully cross compile Qt only apps but when I link to matrix_creator_hal lib I get theses errors during link:

    libmatrix_creator_hal.so comes from? The package manager? This looks like a version/compiler mismatch error. Make sure the standard library (libstdc++) used for libmatrix_creator_hal.so is the same as the one you have when linking. Compilers must be producing binary compatible code, naturally.



  • @kshegunov Yes libmatrix_creator_hal comes from the package manager

    Ok so ldd on libmatrix_creator_hal gives me:

    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76bc3000)
    

    On the other side my compiler is gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03)

    So it means I should use GCC 6 to match the compiler that lib has been built with ?


  • Qt Champions 2017

    @X-Krys said in Cross compilation issues Qt + libmatrix_creator_hal:

    So it means I should use GCC 6 to match the compiler that lib has been built with ?

    6 is the library version, so you should use the same major version of the stdc++ (assuming they keep binary compatibility, which I'm not sure about). Also you need to use a compiler that produces code that is binary compatible with the compiler used to build that library, unfortunately I have no clue which version is that exactly, but I really doubt it's as old as gcc 4.8.3.


Log in to reply