![]() |
|
#1
|
|||
|
|||
OpenGL - using CHi i am trying to compile a opengl graphics file on linux does anyone know how to get he program to execute? thanks for your help
|
|
#2
|
|||
|
|||
Re: OpenGL - using Clike any other linux program
./programname |
|
#3
|
|||
|
|||
Re: OpenGL - using CQuote:
Create a new directory under your home and cd into it. Code:
Download or copy a source file from somewhere. Here is hello.c from http://www.opengl.org/resources/code/samples/redbook/ CPP / C++ / C Code:
Create a file named Makefile. Here is an example. (Just paste it directly from this post.) Code:
Note that it is very important for the GNU make program that the line containing $(CC)... that the leading character is a tab, not spaces. Also for the line after dlean:, the leading character is a tab character, not spaces. Enter the following at the command line: make When I do this on my Centos Linux system I see the following: Code:
There were no messages of any kind from the compiler or linker The directory now contains three files, the source file, the make file, and the executable, named "hello" Enter the following on the command line: Code:
I get a window with "hello" in the title bar. The display in the window consists of a white square inside a black square. Now, if something else happens at any of these steps, then tell us exactly what happened. Also, and this is important, tell us what Linux distribution you are using. Regards, Dave Footnote: you don't have to have a Makefile; you can just enter the command by hand: Code:
But you might as well get used to using some of the tools that are available on your Linux system. Other gl projects can start with a copy of the makefile that I showed; just use your program name in place of "hello.c" and "hello". More complicated projects will have additional things in their Makefiles, but this is a start. |
|
#4
|
|||
|
|||
Re: OpenGL - using CQuote:
It has been pointed out to me that the file I previously posted was not hello.c. In fact, the particular program that I posted may not work on all systems (depending on your video card's graphics capabilities and depending on what video driver modules you have installed). Here is the real hello.c. It should work for any Linux platform that has glut libraries and glut development libraries. If it works for you, I recommend that you download "redbook.zip" from the site that I linked above. Many other examples are illustrated there. Regards, Dave |
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OpenGL in Normal FLTK Windows | automatedreason | FLTK Forum | 2 | 25-Apr-2008 05:44 |
| What is OpenGL? | Shrikharan | OpenGL Programming | 6 | 21-Dec-2005 17:47 |
| C++ game programming OpenGL | oozsakarya | OpenGL Programming | 2 | 13-Nov-2005 13:50 |
| nVidia & OpenGL Problems in windows XP | marjasin | Computer Hardware Forum | 21 | 30-Aug-2004 00:57 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The