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. cannot find -lQtOpenGL and -lGL
Forum Updated to NodeBB v4.3 + New Features

cannot find -lQtOpenGL and -lGL

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
16 Posts 2 Posters 3.6k 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.
  • Z Offline
    Z Offline
    Zola
    wrote on last edited by
    #1

    I have problem that I'm missing those two libraries to compile, but mesa-common-dev is installed, what else should I try?

    Here is the main.cpp file:

    #include "mainwindow.h"
    #include <QApplication>
    #include <QtMultimediaKit/QMediaPlayer>
    #include <QtMultimediaKit/QMediaPlaylist>
    #include <QtMultimediaKit/QVideoWidget>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QMediaPlayer *player = new QMediaPlayer;

    QMediaPlaylist *playlist = new QMediaPlaylist(player);
    playlist->addMedia(QUrl("http://example.com/myclip1.mp4"));
    playlist->addMedia(QUrl("http://example.com/myclip2.mp4"));
    
    QVideoWidget *videoWidget = new QVideoWidget;
    player->setVideoOutput(videoWidget);
    
    videoWidget->show();
    playlist->setCurrentIndex(1);
    player->play();
    //MainWindow w;
    //w.show();
    
    return a.exec();
    

    }

    and here is my .pro file:

    #-------------------------------------------------

    Project created by QtCreator 2015-11-25T00:07:36

    #-------------------------------------------------

    QT += core gui multimedia opengl

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = videoplayer
    TEMPLATE = app

    INCLUDEPATH += /usr/include/QtMultimediaKit
    INCLUDEPATH += /usr/include/QtMobility

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please search the forum a bit, that question has been asked many times already. You are missing the OpenGL dev package e.g. apt-get install libgl1-mesa-dev

      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
      0
      • Z Offline
        Z Offline
        Zola
        wrote on last edited by Zola
        #3

        Hey @SGaist I already installed it and problem is the same.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What version of Qt are you using ?

          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
          0
          • Z Offline
            Z Offline
            Zola
            wrote on last edited by Zola
            #5

            @SGaist Qt 4.8.6 :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you re-run qmake after adding QT += opengl ?

              If so, how did you install Qt ?

              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
              0
              • Z Offline
                Z Offline
                Zola
                wrote on last edited by
                #7

                @SGaist I installed it from source using QtCreator 3.5.1 and Qt 4.8.6 on my Ubuntu 14.04.3 LTS Virtual Machine. I re-run it and it's the same. How to include opengl module when doing ./configure step? Is it required or it is included by default?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Since you built it yourself and didn't had the OpenGL dev lib, it was built without. You have to build Qt again (from scratch with a new call to configure). While you're at it, you should consider using 4.8.7.

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

                  Z 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Since you built it yourself and didn't had the OpenGL dev lib, it was built without. You have to build Qt again (from scratch with a new call to configure). While you're at it, you should consider using 4.8.7.

                    Z Offline
                    Z Offline
                    Zola
                    wrote on last edited by
                    #9

                    @SGaist how to include opengl lib when doing ./configure. I tried ./configure -opengl es2 but I am getting errors.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      If you installed everything it should be detected automatically. The errors is because you don't have OpenGL es2 installed. But since you're on a desktop just use the desktop OpenGL.

                      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
                      0
                      • Z Offline
                        Z Offline
                        Zola
                        wrote on last edited by
                        #11

                        @SGaist If I am building whole project on Ubuntu desktop machine, should I use -opengl desktop or es2, because I'm building that up for BeagleBone Black?

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          So you're cross-compiling ?

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

                          Z 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            So you're cross-compiling ?

                            Z Offline
                            Z Offline
                            Zola
                            wrote on last edited by
                            #13

                            @SGaist yes, sorry for not telling you that earlier. I need opengl for embedded (BeagleBone Black armhf) but i need to install opengl and write correct paths for embedded opengl in my qmake.conf file.

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              What distribution are you using for that board ? It should provide everything you need (headers + lib) IIRC there's already a mkspec for the BeagleBoard

                              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
                              0
                              • Z Offline
                                Z Offline
                                Zola
                                wrote on last edited by
                                #15

                                @SGaist Debian Wheezy

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  You should take a look at this thread. The poster has provided links to an interesting Wiki to build everything you need before building Qt.

                                  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
                                  0

                                  • Login

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