Thread: Developing In Linux With OpenGL

  1. #1
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229

    Developing In Linux With OpenGL

    OK, so before I accidentally switched to Linux, I was working with OpenGL on Windows make some arcade game clones. From searching it appears that there are a few library's to choose from that implement OpenGL with Linux (I think). I'm completly new to Linux and don't know what libs, dll's (or the Linux equivalent), and headers I need. If someone could link me to and article they know of, or just briefly explain that would be awesome.

    Thank you,
    David

    edit: Using codeblocks btw

  2. #2
    Massively Single Player AverageSoftware's Avatar
    Join Date
    May 2007
    Location
    Buffalo, NY
    Posts
    141
    Most X11 installs include the OpenGL headers and libraries. You'll need to include GL/glx.h, GL/gl.h, and you'll probably want GL/glu.h.

    The names of the libraries you need to link with escape me right now. They might be as simple as libgl and libglu.

  3. #3
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    I think its the xlibmesa? When I was working in Windows I had to link the libs aswell, Is there anything I need to link in Linux?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    With GCC or g++, to link to a library called libsomething.a, you use the -lsomething command line option, after everything else. The -l (lowercase L) options have to be after the source and/or object files for the options to be applied to them.

    I'm not sure exactly which libraries you need to link to, but AverageSoftware's suggestion sounds about right.
    Code:
    $ gcc *.o -lGL -lGLu
    Note that on Linux, the case of the libraries matters too, so try uppercase and lowercase.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Actually I found it was called mesa-common-dev. It also installed .so lib files which is what I was asking about.

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Also, try listing GLu before GL.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  2. installing linux for the first time
    By Micko in forum Tech Board
    Replies: 9
    Last Post: 12-06-2004, 05:15 AM
  3. Linux OpenGL Books
    By snotty_gnome in forum Linux Programming
    Replies: 1
    Last Post: 10-03-2004, 06:46 PM
  4. Linux for Windows!
    By Strut in forum Linux Programming
    Replies: 2
    Last Post: 12-25-2002, 11:36 AM
  5. Linux? Windows Xp?
    By VooDoo in forum Linux Programming
    Replies: 15
    Last Post: 07-31-2002, 08:18 AM