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. Linux: Linking with static Qt fails
Forum Update on Monday, May 27th 2025

Linux: Linking with static Qt fails

Scheduled Pinned Locked Moved Installation and Deployment
staticlinux
2 Posts 1 Posters 2.1k 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.
  • C Offline
    C Offline
    Chuck R
    wrote on last edited by
    #1

    I am attempting to build FlightGear on an Ubuntu 14.04 system. Unfortunately, the Ubuntu 14.04 Qt libraries are not up to par for what is required for FlightGear. Since I will only be using this Qt build for this single application, I opted for a static build.

    I used the following configure command:

    ./configure -static -opensource -nomake tests -gtkstyle -prefix /home/user/Qt/5.4/Src/qtbuild -no-rpath -no-compile-examples -system-proxies -skip qtwebkit -skip qtwebkit-examples -nomake tools -nomake examples -skip script -release -skip multimedia -verbose -l dl -skip location -skip multimedia -skip quick1 -skip quickcontrols -skip sensors -skip serialport -skip svg -skip tools -skip translations -skip wayland -skip webchannel -skip webengine -skip xmlpatterns -skip activeqt -skip connectivity -skip declarative -skip doc -skip enginio -skip graphicaleffects -skip imageformats -skip websockets

    The compile appear to work just fine, but as soon as I attempt build FlightGear I get the following error at the linking stage:

    Linking CXX executable fgfs
    /usr/bin/ld: /home/charles/Qt/5.4/Src/qtbuild/lib/libQt5Core.a(qlibrary_unix.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
    /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status

    This appears to be an error with my static Qt build not being linked to libdl.so -- or something? The above configure command is not my original. I had added -l dl in order to fix the problem, but to no avail. Any help at all would be appreciated!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chuck R
      wrote on last edited by
      #2

      I suppose I got it sorted by adding an -ldl flag in the FlightGear compile. Strangely enough, the first time I tried it it didn't work at all. I tried it again and it magically worked. Now I'm going to be building/rebuilding for the next several hours just to figure out how exactly I fixed it...

      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