Results 1 to 6 of 6

Thread: I can't get C++/Ogl/glut to compile on Linux... Please help...

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    I can't get C++/Ogl/glut to compile on Linux... Please help...

    When I programmed in Ogl previously, I used C.
    I actually compiled it on Solaris Unix, but the compilation command was the same as on Linux:
    gcc source.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXi -lXaw -lXext -lX11 -lm -o executable
    Now, I've done my first asteroid game in C++. I've worked on VS .NET 2003, so no linking problems there... but I now need to make it compile on Linux... and I have no makefile
    Could someone please tell me how to do it? (Not the makefile, but the compilation command (i.e. libraries linking etc...)
    For compilers, we have gcc and g++.
    Or perhaps if you'd happen to have a makefile template...
    Huge thanks for the help.
    Luke

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    201

    Re: I can't get C++/Ogl/glut to compile on Linux... Please help...

    are you by any chance running red hat 9? I have red hat 9 and I have been having trouble compiling on linux even though glut and gl came installed on my system. On any other system all you should have do to is
    g++ -c yourfile.cpp -I(you would put here the path of glut and gl if it is not in its normal place)

    after you have all your objects you would do

    g++ -o yourobjects -lGL -lGLU -lglut -lm

    but dont forget -L(your path if the libs are not in usr/lib)

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: I can't get C++/Ogl/glut to compile on Linux... Please help...

    It would be nice if you posted what the link error was?

    Also post what version of Linux you are using?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Re: I can't get C++/Ogl/glut to compile on Linux... Please help...

    Sorry, I asked about compiling under Linux but as I wrote in the post, I'm actually compiling under Solaris Unix (which will be the same as Linux). The reason I wrote Linux is because I know more people use it as opposed to Solaris Unix

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: I can't get C++/Ogl/glut to compile on Linux... Please help...

    And the error you are getting is....??
    Deiussum
    Software Engineer and OpenGL enthusiast

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Re: I can't get C++/Ogl/glut to compile on Linux... Please help...

    Please see my other post (about g++). I think this error has actually nothing to do with linking.... I think it's g++...

Similar Threads

  1. How to compile under Linux
    By Rana in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-16-2004, 12:06 PM
  2. Compile Linux to NT
    By svd in forum OpenGL: Windows
    Replies: 1
    Last Post: 02-16-2004, 04:24 AM
  3. compile opengl & glut in linux redhat
    By fran24 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-22-2003, 09:39 AM
  4. How to compile Opengl with glut on Linux
    By nexusone in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-06-2003, 02:29 PM
  5. how i may compile sdl in linux
    By c_anindya in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2002, 01:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean