Qt Creator C++ template that I *just created* and didn't modify throws "cannot find file or directory -lGL" error when compiling.
-
Template used: Application (Qt) -> Qt Widgets Application
Make version: 4.3
Qt version: 6.9.0 (GCC 10.3.1 20210422 (Red Hat 10.3.1-1), x86_64)
Qt Creator version: 16.0.2OS: Linux Mint 22.1
Also, here's the full compile log:
14:23:30: Running steps for project test... 14:23:30: Starting: "/home/pi-squared/Qt/6.9.0/gcc_64/bin/qmake" /home/pi-squared/qt/test/test.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug Info: creating stash file /home/pi-squared/qt/test/build/Desktop_Qt_6_9_0-Debug/.qmake.stash 14:23:30: The process "/home/pi-squared/Qt/6.9.0/gcc_64/bin/qmake" exited normally. 14:23:30: Starting: "/bin/make" -f /home/pi-squared/qt/test/build/Desktop_Qt_6_9_0-Debug/Makefile qmake_all make: Nothing to be done for 'qmake_all'. 14:23:30: The process "/bin/make" exited normally. 14:23:30: Starting: "/bin/make" -j8 /home/pi-squared/Qt/6.9.0/gcc_64/libexec/uic ../../mainwindow.ui -o ui_mainwindow.h g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -fPIC -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../test -I. -I../../../../Qt/6.9.0/gcc_64/include -I../../../../Qt/6.9.0/gcc_64/include/QtWidgets -I../../../../Qt/6.9.0/gcc_64/include/QtGui -I../../../../Qt/6.9.0/gcc_64/include/QtCore -I. -I. -I../../../../Qt/6.9.0/gcc_64/mkspecs/linux-g++ -o main.o ../../main.cpp /home/pi-squared/Qt/6.9.0/gcc_64/bin/lrelease ../../test_en_US.ts -qm .qm/test_en_US.qm g++ -pipe -g -std=gnu++1z -Wall -Wextra -fPIC -dM -E -o moc_predefs.h ../../../../Qt/6.9.0/gcc_64/mkspecs/features/data/dummy.cpp Updating '.qm/test_en_US.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -fPIC -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../test -I. -I../../../../Qt/6.9.0/gcc_64/include -I../../../../Qt/6.9.0/gcc_64/include/QtWidgets -I../../../../Qt/6.9.0/gcc_64/include/QtGui -I../../../../Qt/6.9.0/gcc_64/include/QtCore -I. -I. -I../../../../Qt/6.9.0/gcc_64/mkspecs/linux-g++ -o mainwindow.o ../../mainwindow.cpp /home/pi-squared/Qt/6.9.0/gcc_64/libexec/rcc -name qmake_qmake_qm_files qmake_qmake_qm_files.qrc -o qrc_qmake_qmake_qm_files.cpp g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -fPIC -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../test -I. -I../../../../Qt/6.9.0/gcc_64/include -I../../../../Qt/6.9.0/gcc_64/include/QtWidgets -I../../../../Qt/6.9.0/gcc_64/include/QtGui -I../../../../Qt/6.9.0/gcc_64/include/QtCore -I. -I. -I../../../../Qt/6.9.0/gcc_64/mkspecs/linux-g++ -o qrc_qmake_qmake_qm_files.o qrc_qmake_qmake_qm_files.cpp /home/pi-squared/Qt/6.9.0/gcc_64/libexec/moc -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/pi-squared/qt/test/build/Desktop_Qt_6_9_0-Debug/moc_predefs.h -I/home/pi-squared/Qt/6.9.0/gcc_64/mkspecs/linux-g++ -I/home/pi-squared/qt/test -I/home/pi-squared/Qt/6.9.0/gcc_64/include -I/home/pi-squared/Qt/6.9.0/gcc_64/include/QtWidgets -I/home/pi-squared/Qt/6.9.0/gcc_64/include/QtGui -I/home/pi-squared/Qt/6.9.0/gcc_64/include/QtCore -I. -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13 -I/usr/include/c++/13/backward -I/usr/lib/gcc/x86_64-linux-gnu/13/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include ../../mainwindow.h -o moc_mainwindow.cpp g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -fPIC -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../test -I. -I../../../../Qt/6.9.0/gcc_64/include -I../../../../Qt/6.9.0/gcc_64/include/QtWidgets -I../../../../Qt/6.9.0/gcc_64/include/QtGui -I../../../../Qt/6.9.0/gcc_64/include/QtCore -I. -I. -I../../../../Qt/6.9.0/gcc_64/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp g++ -Wl,-rpath,/home/pi-squared/Qt/6.9.0/gcc_64/lib -Wl,-rpath-link,/home/pi-squared/Qt/6.9.0/gcc_64/lib -o test main.o mainwindow.o qrc_qmake_qmake_qm_files.o moc_mainwindow.o /home/pi-squared/Qt/6.9.0/gcc_64/lib/libQt6Widgets.so /home/pi-squared/Qt/6.9.0/gcc_64/lib/libQt6Gui.so /home/pi-squared/Qt/6.9.0/gcc_64/lib/libQt6Core.so -lpthread -lGL /bin/ld: cannot find -lGL: No such file or directory collect2: error: ld returned 1 exit status make: *** [Makefile:310: test] Error 1 14:23:38: The process "/bin/make" exited with code 2. 14:23:38: Error while building/deploying project test (kit: Desktop Qt 6.9.0) 14:23:38: When executing step "Make" 14:23:38: Elapsed time: 00:08.
-
Hi and welcome to devnet,
You are missing the OpenGL development library.
apt-get install libgl-dev
-
Hi and welcome to devnet,
You are missing the OpenGL development library.
apt-get install libgl-dev
@SGaist I feel so stupid now... Anyway, thanks for the help!
-
-
I forgot to mark it as solved