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 3 of 3

Thread: using open gl on ubuntu

  1. #1
    Newbie Newbie
    Join Date
    Oct 2012
    Posts
    1

    using open gl on ubuntu

    IAM GETTING THESE ERRORS WHEN COMPILING A PROGRAM. CAN U PLZ HELP ME OUT WITH THIS...


    user@user-ThinkCentre-M57e:~/Desktop$ g++ 4.cpp -lglut
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glClearColor'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glClear'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glColor3f'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glOrtho'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glBegin'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glVertex2f'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glVertex2f'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glVertex2f'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glVertex2f'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glEnd'
    /tmp/ccEmvIhH.o:4.cpp:function renderFunction(): error: undefined reference to 'glFlush'
    collect2: ld returned 1 exit status

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2011
    Location
    Montana, USA
    Posts
    16
    You need to link to the OpenGL libraries.
    most likely they are:
    /usr/lib/i386-linux-gnu/libGLU.so
    /usr/lib/libGL.so
    assert(this.post != (new BadPost(this.guyname, 1/0).IsTerrible());
    Assertion Failed!

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,191
    Simpler: just add -lGL to the link line.

Posting Permissions

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