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. Wrong link paths at cross-compiling Qt 5.15.2

Wrong link paths at cross-compiling Qt 5.15.2

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
cross-compileqt5.15.2qt sources
2 Posts 2 Posters 786 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.
  • K Offline
    K Offline
    Kiruseni
    wrote on 7 Mar 2022, 14:47 last edited by
    #1

    Hello.
    I have a small problem. Compiled Qt from source.

    ../qt5.15.2/qtbase/configure -release -no-gui -device linux-xilinx7020-g++ -device-option CROSS_COMPILE=~/Documents/compilers/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot ../sysroot -prefix /opt/Qt/5.15.2 -extprefix ../ready-qt -hostprefix ../tools-qt -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker -v -no-gcc-sysroot -no-dbus
    

    It was assumed that executable file would be linked with Qt library at address specified in the variable PREFIX = /opt/Qt/5.15.2, and all other system libraries would be taken at addresses from the sysroot. But when I calling ldd on the target machine, Qt library is linked using the standard path.

    [test@localhost bin]$ ldd testFirmware                                      
            libQt5SerialPort.so.5 => /usr/lib/libQt5SerialPort.so.5 (0xb6f62000)    
            libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0xb6b9c000)                
            libpthread.so.0 => /lib/libpthread.so.0 (0xb6b77000)                    
            libatomic.so.1 => /usr/lib/libatomic.so.1 (0xb6b60000)                  
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6a4d000)                  
            libm.so.6 => /lib/libm.so.6 (0xb69cd000)                                
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb69a4000)                        
            libc.so.6 => /lib/libc.so.6 (0xb68ab000)                                
            libudev.so.1 => /lib/libudev.so.1 (0xb6882000)                          
            /lib/ld-linux-armhf.so.3 (0xb6f9c000)                                   
            libz.so.1 => /lib/libz.so.1 (0xb685f000)                                
            libicui18n.so.65 => /usr/lib/libicui18n.so.65 (0xb6673000)              
            libicuuc.so.65 => /usr/lib/libicuuc.so.65 (0xb652b000)                  
            libdl.so.2 => /lib/libdl.so.2 (0xb6518000)                              
            libpcre2-16.so.0 => /lib/libpcre2-16.so.0 (0xb64af000)                  
            libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb63ca000)                  
            libicudata.so.65 => /usr/lib/libicudata.so.65 (0xb490a000)              
            libpcre.so.3 => /lib/libpcre.so.3 (0xb48c6000)  
    

    How to fix it? I need solution that all Qt-related libraries use the path from PREFIX (do not add each library manually). Maybe need add something into pro file or change something in the qmake settings file.

    Thanks in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Mar 2022, 20:52 last edited by
      #2

      Hi,

      You can set the LD_LIBRARY_PATH environment variable before starting your application. Otherwise, if memory serves well, you need to configure the rpath when building your application. See QMAKE_RPATHDIR.

      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
      1

      1/2

      7 Mar 2022, 14:47

      • Login

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