Find the answer to your Linux question:
Results 1 to 5 of 5
hey all I have fedora 12 and have just installed it.I am having lots of trouble installing opengl in linux. I want to link its libraries with gcc so that ...
  1. #1
    nk1
    nk1 is offline
    Just Joined!
    Join Date
    Apr 2010
    Posts
    8

    Opengl for linux

    hey all

    I have fedora 12 and have just installed it.I

    am having lots of trouble installing opengl in linux.

    I want to link its libraries with gcc so that i am able to run my c code.

    Can someone please tell me how to do it .

    Thanxx!!

  2. #2
    Linux Newbie
    Join Date
    Apr 2010
    Location
    Novosibirsk, Russia
    Posts
    136
    Quote Originally Posted by nk1 View Post
    hey all

    I have fedora 12 and have just installed it.I

    am having lots of trouble installing opengl in linux.

    I want to link its libraries with gcc so that i am able to run my c code.

    Can someone please tell me how to do it .

    Thanxx!!
    you can link any library with gcc like that:
    Code:
    1. Cut off a 'lib' prefix from a name of your library.
    2. Add '-l' prefix.
    3. Just pass it to gcc ! :)
    as I remember, using opengl library is like -lGL or -lgl

  3. #3
    nk1
    nk1 is offline
    Just Joined!
    Join Date
    Apr 2010
    Posts
    8
    Thanks for answering.......
    Do you know whether the libraries for opengl and glut are preinstalled in linux or not...........

    Thanxx...................

  4. #4
    Linux Newbie
    Join Date
    Apr 2010
    Location
    Novosibirsk, Russia
    Posts
    136
    Quote Originally Posted by nk1 View Post
    Thanks for answering.......
    Do you know whether the libraries for opengl and glut are preinstalled in linux or not...........

    Thanxx...................
    header files must be in /usr/include (or any other directory where your system stores header files), in a folder name GL, then your code must have:
    Code:
     #include <GL/gl.h>
    #include <GL/glut.h>
    opengl libraries must be already installed, if you install your linux distro as for developing.

  5. #5
    Just Joined!
    Join Date
    Apr 2010
    Location
    Edinburgh, Scotland
    Posts
    4
    Remember to install the graphics card drivers or your nicely written programs may not run very well.

    You can check the extensions you require for your code to compile are there with the glxinfo command.

Posting Permissions

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