Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Urgent issue regarding to linking GL!!

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    19

    Post Urgent issue regarding to linking GL!!

    I have installed freeglut on cygwin,
    and trying to build my project, which works Ok in MSVS, but getting following errors:

    g++ -static obj/MatrixDistortion.o obj/LookAt.o obj/MatrixT.o obj/Matrix2d.o obj/Camera.o obj/Grid.o obj/s_w_project.o obj/Scene.o -o SWproject -L/usr/lib -L/usr/X11/lib -L/lib/cygwin -L/usr/local/lib -lglut -lopengl32 -lglu32
    obj/Grid.o:Grid.cpp:(.text+0xa36): undefined reference to `_glPushMatrix'
    obj/Grid.o:Grid.cpp:(.text+0xa87): undefined reference to `_glMultMatrixd'
    obj/Grid.o:Grid.cpp:(.text+0xaac): undefined reference to `_glTranslatef'
    obj/Grid.o:Grid.cpp:(.text+0xab8): undefined reference to `_glClear'
    obj/Grid.o:Grid.cpp:(.text+0xad7): undefined reference to `_glColor3f'
    obj/Grid.o:Grid.cpp:(.text+0xae3): undefined reference to `_glBegin'
    obj/Grid.o:Grid.cpp:(.text+0xb2c): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xb4f): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xbb4): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xbd7): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xc1e): undefined reference to `_glColor3f'
    obj/Grid.o:Grid.cpp:(.text+0xc3d): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xc5c): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xc7b): undefined reference to `_glColor3f'
    obj/Grid.o:Grid.cpp:(.text+0xc9a): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xcb9): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xcd8): undefined reference to `_glColor3f'
    obj/Grid.o:Grid.cpp:(.text+0xcf7): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xd16): undefined reference to `_glVertex3f'
    obj/Grid.o:Grid.cpp:(.text+0xd1b): undefined reference to `_glEnd'
    obj/Grid.o:Grid.cpp:(.text+0xd20): undefined reference to `_glPopMatrix'
    obj/Grid.o:Grid.cpp:(.text+0xd25): undefined reference to `_glFlush'
    /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: obj/Grid.o: bad reloc address 0xd in section `.text$_ZNSt4listIP6CameraSaIS1_EED1Ev[std::list<Camera*, std::allocator<Camera*> >::~list()]'
    /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
    collect2: ld returned 1 exit status
    Makefile:14: recipe for target `SWproject' failed




    P.S.
    note that I have passed libraries to g++
    P.P.S
    do I have to install Gl separately, but in that case why I don't get an error on '#include <GL/gl.h>?

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    19
    I solved the problem, you cane see result here http://www.youtube.com/watch?v=2JL1IokHheI

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •