Results 1 to 14 of 14

Thread: Problem with opengl

  1. #1
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with opengl

    Dear All,

    I am having some problem with using openGL in Qt 4. When I try to include <OpenGL> or <QtGLWidget> but, it does not support.

    I have added a paramter
    QT += opengl in my .pro file. But then also my problem not solved. I have doubt that my system have the driver for openGl or not? I am using ubuntu 10.4 lts.

    So please tell me how will I check that whether my system supports OpenGL or not?
    In case if it does not support openGL, how will i install it?

    And, finally I need to use <QtGLWidget> & <qgl.h> in program. So how to solve this?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with opengl

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    rajg (26th July 2012)

  4. #3
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    Thank you high_flyer and all,

    Now I have installed and check.
    OpenGL is enabled in my system. But still I am not able to include<OpenGL> and <QtGlWidget> in Qt.
    How to enable OpenGL in Qt. I tried it from using ./configure command. But i got the error "command not found". And configure command is not there in Qt directory.

    So, please tell me how to enable <OpenGL> in Qt.

    Thanks.

  5. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with opengl

    ow to enable OpenGL in Qt. I tried it from using ./configure command. But i got the error "command not found". And configure command is not there in Qt directory.
    Sounds like the Qt develop environment is not installed.
    Check with your favorite package installer for Qt development package, and the Qt source.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #5
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    I have installed:
    -> qt-everywhere-opensource-src-4.8.0.tar.gz and
    -> qt-creator-linux-x86-opensource-2.5.0.bin

    I checked "include" directory. 'QtOpenGL' is not there.
    Please tell me how to solve this.


    Thanx.
    Last edited by rajg; 26th July 2012 at 09:49. Reason: spelling corrections

  7. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with opengl

    What do you mean by "installed"?
    Can you list the steps from downloading to building?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #7
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    Probably I used the following:

    First i unzipped. then:

    ./configure

    make

    su -c make install

  9. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with opengl

    What did the output of configure say?
    Maybe it could not build your opengl module due to missing dependencies.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #9
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    I haven't remember that what was the message at that time.

    I again reinstalled Qt.
    But again OpenGL support I am not getting. Please instruct me the how to get it.

    Thanx.

  11. #10
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with opengl

    Quote Originally Posted by rajg View Post
    Dear All,

    I am having some problem with using openGL in Qt 4. When I try to include <OpenGL> or <QtGLWidget> but, it does not support.
    The first include has nothing to do with Qt unless you meant:
    Qt Code:
    1. #include <QtOpenGL>
    To copy to clipboard, switch view to plain text mode 

    The second include should be:
    Qt Code:
    1. #include <QGLWidget>
    To copy to clipboard, switch view to plain text mode 
    Note: no 't'.

    This process would have been much easier if you had posted the actual compiler error messages which presumably read "File not found" or the like.
    Last edited by ChrisW67; 31st July 2012 at 06:26.

  12. The following user says thank you to ChrisW67 for this useful post:

    rajg (31st July 2012)

  13. #11
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    Thank you for notice ChrisW67,

    It was typo for here.
    In program code I am using exactly what you have mentioned.
    But the main problem is that, Qt is not taking the support of 'OpenGL'. I am trying to resolve this.

    Thanx.

  14. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with opengl

    What is the error message? What does "not taking the support of OpenGL" mean?

  15. #13
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with opengl

    When I Run the code, the following error message comes:

    QtOpenGL : no such file or directory.
    QGlWidget : no such file or directory.

    When OpenGL is there in Qt then it should present in 'include' directory. But it is not there.
    So please, tell me how to include and use OpenGL in Qt.

    Thanx.

  16. #14
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with opengl

    The error messages you have paraphrased look like error messages from the compiler: they have nothing to do with running the program. Once again you have mistyped QGLWidget. Copy and paste the actual error messages and the commands that generated them. In Qt Creator they appear in the Compiler Output pane.

    If the files QtOpenGL and QGLWidget do not appear on your system then you have to:
    • install a package containing that library and includes from the Ubuntu repositiory, or
    • or build your own Qt libraries from source with Open GL support.

    Which do you think you have done? If Qt OpenGL support is totally absent on your system then chances are that qmake is generating a message about the "opengl" option in the QT variable... have you looked?

Similar Threads

  1. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 09:37
  2. OpenGL problem
    By babu198649 in forum Installation and Deployment
    Replies: 1
    Last Post: 27th February 2008, 11:31
  3. opengl problem
    By drinu21 in forum Qt Programming
    Replies: 3
    Last Post: 28th December 2007, 11:30
  4. Qt 4.2.0 OpenGL problem
    By mbjerkne in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2006, 18:39

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.