When running make, the following errors appear in terminal:

//usr/local/lib/liblua.a(loadlib.o) : In function « lookforfunc » : loadlib.c:(.text+0x576): warning : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Widgets
/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Gui
/usr/bin/x86_64-linux-gnu-ld : cannot find -lQt5Core
/usr/bin/x86_64-linux-gnu-ld : cannot find -lGL
collect2: error: ld returned 1 exit status

2 Answers 2


I did search on packages.ubuntu.com.

According to it you need the following packages:

  • for compilation:

    sudo apt-get install qtbase5-dev libgl1-mesa-dev 
  • at run time:

    sudo apt-get install libqt5widgets5 libqt5gui5 libqt5core5a libgl1
  • well, I have found the libs, I have copied libQt5Widgets.so and others from /usr/lib/x86_64-linux-gnu to /usr/lib but the errors still appear. Aug 4, 2018 at 19:02
  • You should not copy anything from anywhere to the places maintained by package manager (APT)!!! With such actions you can trash and mess your system!!! If you want to copy some lib, copy it to the folder folder with your compiled binary.
    – N0rbert
    Aug 4, 2018 at 19:11
  • sorry, I'm kinda eager to solve this... lol Aug 4, 2018 at 21:27

I have solved it by adding these entries in the projects ".pro" file and then generating again the Makefile with qmake.

The entries are:
QMAKE_CFLAGS += -no-pie
QMAKE_LFLAGS += -no-pie -fPIC
LIBS += -llua -ldl -L/usr/lib/x86_64-linux-gnu/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .