Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator C++ template that I *just created* and didn't modify throws "cannot find file or directory -lGL" error when compiling.
Forum Updated to NodeBB v4.3 + New Features

Qt Creator C++ template that I *just created* and didn't modify throws "cannot find file or directory -lGL" error when compiling.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 116 Views 1 Watching
  • 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
    pi-squared
    wrote last edited by
    #1

    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.2

    OS: 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.
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi and welcome to devnet,

      You are missing the OpenGL development library.

      apt-get install libgl-dev

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi and welcome to devnet,

        You are missing the OpenGL development library.

        apt-get install libgl-dev

        P Offline
        P Offline
        pi-squared
        wrote last edited by
        #3

        @SGaist I feel so stupid now... Anyway, thanks for the help!

        1 Reply Last reply
        2
        • P pi-squared has marked this topic as solved
        • P Offline
          P Offline
          pi-squared
          wrote last edited by
          #4

          I forgot to mark it as solved

          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