Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt6 Cross compilation GLIBC_2.29 undefined reference problem
Forum Updated to NodeBB v4.3 + New Features

Qt6 Cross compilation GLIBC_2.29 undefined reference problem

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 2.0k 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.
  • P Offline
    P Offline
    PhysicsX
    wrote on last edited by
    #1

    Hello everyone,

    I try to compile qt on ubuntu host machine for target machine.
    I successfully compiled the Qt6 Core. But I can not compile simple example with cmake for target.

    my cmake

    cmake_minimum_required(VERSION 3.5)
    project(HelloQt6 LANGUAGES CXX)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt6Core)
    add_executable(HelloQt6 main.cpp)
    target_link_libraries(HelloQt6 Qt6::Core)
    
    

    main.cpp

    #include <QCoreApplication>
    #include <QDebug>
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
        qDebug()<<"Hello world";
        return a.exec();
    }
    

    When I run the qt-cmake file to create a makefile there is no problem
    But during linking I am getting this:

    /opt/rpi/rpi-gcc-8.3.0/lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: /home/user/rpi-sdk/sysroot/usr/lib/arm-linux-gnueabihf//libicui18n.so.67: undefined reference to `log@GLIBC_2.29'
    /opt/rpi/rpi-gcc-8.3.0/lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: /home/user/rpi-sdk/sysroot/usr/lib/arm-linux-gnueabihf//libicui18n.so.67: undefined reference to `pow@GLIBC_2.29'
    
    

    When I check the path libstdc++ is there. With strings tool I can see that

    strings /home/user/rpi-sdk/sysroot/usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep GLIBCXX
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBCXX_3.4.9
    GLIBCXX_3.4.10
    GLIBCXX_3.4.11
    GLIBCXX_3.4.12
    GLIBCXX_3.4.13
    GLIBCXX_3.4.14
    GLIBCXX_3.4.15
    GLIBCXX_3.4.16
    GLIBCXX_3.4.17
    GLIBCXX_3.4.18
    GLIBCXX_3.4.19
    GLIBCXX_3.4.20
    GLIBCXX_3.4.21
    GLIBCXX_3.4.22
    GLIBCXX_3.4.23
    GLIBCXX_3.4.24
    GLIBCXX_3.4.25
    GLIBCXX_3.4.26
    GLIBCXX_3.4.27
    GLIBCXX_3.4.28
    GLIBCXX_DEBUG_MESSAGE_LENGTH
    

    As I understand my application wants to use 3.4 but why it tries to link to 2.29 version?
    Or am I doing something wrong ?

    Any idea ?
    Thank you.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      PhysicsX
      wrote on last edited by
      #2

      After linking fom cmake with

      set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link, ${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
      

      problem is solved.

      Thanks.

      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