Results 1 to 6 of 6

Thread: compile opengl examples

  1. #1
    Join Date
    Feb 2009
    Location
    Maryland
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question compile opengl examples

    Using: kubuntu 8.10

    All i am trying to do as of now is compile the opengl qt examples

    I believe I have everything set up correctly (right packages installed, proprietary nvidia driver installed)

    compiling the hellogl example as so I get

    Qt Code:
    1. jebsky@jeboat:~/kdedev/opengl/hellogl$ qmake -project
    2. jebsky@jeboat:~/kdedev/opengl/hellogl$ qmake "QT += opengl" hellogl.pro
    3. jebsky@jeboat:~/kdedev/opengl/hellogl$ make
    4. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o glwidget.o glwidget.cpp
    5. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o main.o main.cpp
    6. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o window.o window.cpp
    7. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o moc_glwidget.o moc_glwidget.cpp
    8. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o moc_window.o moc_window.cpp
    9. g++ -Wl,--no-undefined -o hellogl glwidget.o main.o window.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread
    10. /usr/bin/ld: cannot find -lGL
    11. collect2: ld returned 1 exit status
    12. make: *** [hellogl] Error 1
    To copy to clipboard, switch view to plain text mode 

    I do not know what usr/bin/ld does....

    any insight would be awesome

    jeff

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compile opengl examples

    according to error there is no OpenGL installed on your machine.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: compile opengl examples

    apt-get install these two packages (and ensure that your Qt installation was configured with -opengl)
    • libgl1-mesa-dev
    • libglu1-mesa-dev

  4. #4
    Join Date
    Feb 2009
    Location
    Maryland
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: compile opengl examples

    how do i configure my qt installation with -opengl?

  5. #5
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: compile opengl examples

    I do it like this:
    • download latest sources
    • unpack, cd to the new directory
    • clear the QMAKESPEC environment variable
    • ./configure -opengl
    • make
    • make install (as root)


    (although the very latest version qt-x11-opensource-src-4.5.0-rc1 fails to install because of some valgrind problem)

  6. #6
    Join Date
    Feb 2009
    Location
    Maryland
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: compile opengl examples

    o i see. So you cant do it installing from package managers?

    now that i know that i should be able to get it

    thanks

    edit: not sure what clear the QMAKESPEC environment variable means but ill wing it
    Last edited by balinsky; 16th February 2009 at 02:06.

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  3. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  4. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21
  5. Compile App using OpenGL and Visual Studios 2003
    By Rayven in forum General Programming
    Replies: 3
    Last Post: 26th April 2007, 15:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.