Freetype2-dev package not found when crosscompiling



  • Hi @all,

    i am trying to crosscompile a plugin for QT5.6, but the necessary freetype2 development package is not found by qmake (->pkg-config).

    I already asked in the freetype forum, with no success.
    So, i would appreciate any advice.

    my system:

    • Host: debian 8, jessie
    • target: raspberry pi 1, raspbian, jessie
    • i installed: libfreetype2-dev on the target through sudo apt-get install
    • i updated my host sysroot

    qt pro file:

    • CONFIG += link_pkgconfig
    • PKGCONFIG += freetype2

    Error message:

    • qmake fails with the message: "Project ERROR: freetype2 development package not found"

    Environment variables:
    sysroot=~/opt_qt_for_rpi/qt5.6.1-1/sysroot
    export PKG_CONFIG_SYSROOT_DIR=${sysroot}
    export PKG_CONFIG_DIR=
    export PKG_CONFIG_DEBUG_SPEW=1
    export PKG_CONFIG_LIBDIR=${sysroot}/usr/lib/pkgconfig:${sysroot}/usr/share/pkgconfig
    export PKG_CONFIG_PATH=${sysroot}
    export COMPILER_PATH=~/opt_qt_for_rpi/qt5.6.1-1/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin

    This is what i tried so far:

    1. Searching for "ft2build.h" on the host: -> it's there in the sysroot folder
      ..sysroot/usr/include/freetype2/ft2build.h

    2. letting pkg-config search for it on the host: -> it's there in the sysroot folder
      set PKG_CONFIG_DEBUG_SPEW
      pkg-config --modversion freetype2

      Output:

    Looking for package 'freetype2'
    Looking for package 'freetype2-uninstalled'
    Reading 'freetype2' from file '/home/niki/opt_qt_for_rpi/qt5.6.1-1/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig/freetype2.pc'
    Parsing package file '/home/niki/opt_qt_for_rpi/qt5.6.1-1/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig/freetype2.pc'
      line>prefix=/usr
     Variable declaration, 'prefix' has value '/usr'
      line>exec_prefix=/usr
     Variable declaration, 'exec_prefix' has value '/usr'
      line>libdir=/usr/lib/arm-linux-gnueabihf
     Variable declaration, 'libdir' has value '/usr/lib/arm-linux-gnueabihf'
      line>includedir=/usr/include/freetype2
     Variable declaration, 'includedir' has value '/usr/include/freetype2'
      line>
      line>Name: FreeType 2
      line>URL: http://freetype.org
      line>Description: A free, high-quality, and portable font engine.
      line>Version: 18.0.12
      line>Requires:
      line>Requires.private:
      line>Libs: -L${libdir} -lfreetype
      line>Libs.private: -lz -lpng12 -lz -lm
    Unknown keyword 'Libs.private' in '/home/niki/opt_qt_for_rpi/qt5.6.1-1/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig/freetype2.pc'
      line>Cflags: -I${includedir}
    Path position of 'freetype2' is 2
    Adding 'freetype2' to list of known packages
    18.0.12
    

    Thanks a lot,
    Nik



  • Thanks for moving the thread.

    Any Ideas for solving my problem?



  • Anybody who could provide some hints?
    How do qmake and pkg-config work together?



  • Ok, i found the solution.
    I had to recompile qmake with pkg-config enabled.



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