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. [SOLVED] Build failure : undefined reference to `gluPerspective'
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Build failure : undefined reference to `gluPerspective'

Scheduled Pinned Locked Moved Installation and Deployment
13 Posts 5 Posters 27.4k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    You need to provide more information: What OS ? What compiler ? What Qt version ?

    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
      Zikkee13
      wrote on last edited by
      #3

      Ubuntu 12.10 with Qt 5.0.1 on QtCreator and g++.

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

        IIRC gluPerspective comes from the glut (freeglut ?) library. Are you linking against the glut library ?

        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
          Zikkee13
          wrote on last edited by
          #5

          I tried using gluPerspective with SDL a few weeks ago and it works with the #include <GL/glu.h>...

          1 Reply Last reply
          0
          • J Offline
            J Offline
            john_god
            wrote on last edited by
            #6

            Why don't you try glFrustum() instead ?

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

              Including glu.h has nothing to do with linking the library. Did you check that your program is linked with glut ?

              What version of OpenGL are you using ? IIRC gluPerspective has been removed since OpenGL 3.0.

              You can also find an implementation called qgluPerspective in the Boxes example

              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
                Zikkee13
                wrote on last edited by
                #8

                I know for the gluPerspective removal since OpenGL 3.x. It's the OpenGL's version I have but as I said glPerspective works with another project with the SDL Library (and same compiler, OpenGL 3.x...) ; that's weird I know... if the glPerspective has been removed...
                I'm going to check if my QtCreator is linked with glut ASAP... but it's GLU, not GLUT, I think. If it was GLUT my function should be glutPerspective, no?

                @john_god, what's the difference between this function and gluPerspective?

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

                  It's GLUT (GLUT stands for OpenGL Utility Toolkit)

                  gluPerspective does some mathematic for you and then uses glFrustrum. Either search for the implementation on google, or grep qgluPerspective in your Qt 5 sources.

                  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
                  • J Offline
                    J Offline
                    john_god
                    wrote on last edited by
                    #10

                    [quote author="Zikkee13" date="1365005409"]@john_god, what's the difference between this function and gluPerspective?[/quote]

                    I'm too lazy to check the specs right now but I think they are the same, the diference is that gluPerspective adds GLUT dependency to your project, glFrustum() is OpenGL native.
                    Go check it out on google :)

                    Edit: Ok I just check them, they are no the same, please check glOrtho(). Basically all this functions do is to setup diferent math perspectives / projections to your world.

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      Zikkee13
                      wrote on last edited by
                      #11

                      I have added GLU .so file (/usr/lib/i386-linux-gnu/libGLU.so) to my project and it works.
                      GLUT is not installed on my laptop and it works without it.

                      Thanks for your help. Solved.

                      Edit : @john_god, OK thanks!

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        gaia
                        wrote on last edited by
                        #12

                        Hello, I have same problem compiling a project in qt5,
                        @ undefined reference to gluPerspective@
                        @undefined reference to gluLookAt@

                        i'm on Debian Wheezy 64bit ..

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          soleyla
                          wrote on last edited by
                          #13

                          I had the same problem as gaia and solved it by adding

                          @LIBS += -lglut -lGLU@

                          to the .pro file of my project

                          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