How do you compile on Linux

I am new to OpenGL Programming on linux, I just installed Mesa and Did a Make Exec to see all there Demos, but I have a program that I wrote on a WIN2K Computer, and wanted to see if it would run on Linux…what is the C Command to compile this? do I type gpp <filename.c> or cpp <filename.c> how is this done? this is a really simple question?

-Leo

you usually write make files…

but the makefiles in glut are super long and at the top they say they where built with imake?

i’m not sure about how to get that working, since i’m pretty new in linux…
but here’s a make file i’m using…

CC = gcc -Wall -pedantic -ansi

all:
$(CC) ext_link.cpp main.c -o portals -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lGL -lGLU -lm -L/usr/lib/ -lglut

clean:
@echo removing stuff
@rm portals
@echo done

DO NOT DELETE

the portals is the name of the executable…
and when you want to build.
just type make in the console when in that folder…

l8rz

gcc -o nameOfOutputFile souceCodeFile.c -L/path/to/libs -I/path/to/includes -lnameOfLib -lnameOfAnotherLib

where the library file represented by nameOfLib
is libnameOfLib.so and also the order you
list the libs matters.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.