linux compile

have i to put a library in addition to these 4 for compiling under linux?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GL/glut.h>

if not how can i compile?
thanks for your help

To compile OpenGL apps under Linux you would do something like so…

g++ source.cpp -lglut -lGL -lGLU

Or you would add something like that to a Makefile so that you wouldn’t have to do that every time.

Just thought I would clarify something… from your post it appears that you are under the impression that the .h files are the libraries. For some reason this seems to be a common misconception. The .h files just give you definitions for functions. The actual implementation of the functions are in the library itself. Many of the common C/C++ libraries are linked in by default, but other libraries are not. (Such as OpenGL, pthreads, etc.)

Think of the .h file as giving you a window to what is in the actual library.

thank you