-1

I'm using linux mint 17.2 and have downloaded everything necessary to program in OpenGL.

When I download test program and save it in text editor as (for example) test.cpp I need to do this command in terminal to compile it:

g++ test.cpp -o proba  -lglut -lGL

I wanna skip this -lglut and -lGL part so it is automatically included. How is it possible ? Can it be done in some IDE like CODEBLOCKS maybe ?

HDJEMAI
  • 7,766
  • 41
  • 60
  • 81
gilley
  • 49
  • 3
  • 5

1 Answers1

3

Create a Makefile that looks like this:

all:
        g++ test.cpp -o proba  -lglut -lGL

Then simply type make and it will compile your program. Note: indent with a TAB in the makefile.

(see https://en.wikipedia.org/wiki/Makefile)

Andy M
  • 566
  • 3
  • 7