advertisement

Article:
  Developing in OpenGL Using Makefiles
Subject:   makefile error
Date:   2005-04-03 15:02:30
From:   possen
I had to make some changes to the makefile otherwise I got a "missing separator error." It was on line 17 where it says:


$(LIBRARIES)
./GlutExample


I changed it as below. Since gcc handles compiling and linking all of that can occur in one line. So I moved the $(LIBRARIES) to that line and I removed the above lines. After that it worked quite nicely. I also found that with emacs I can launch the program by typing meta-x command-shell then entering the name of the program ./GlutExample. Also be very careful about using tabs where things are indented, and make sure there are no extra spaces at the ends of lines.


LIBPATH = -L"/System/Library/Frameworks/OpenGL.framework/Libraries"


FRAMEWORK = -framework GLUT
FRAMEWORK += -framework OpenGL


COMPILERFLAGS = -Wall
CC = g++
CFLAGS = $(COMPILERFLAGS)
LIBRARIES = -lGL -lGLU -lm -lobjc -lstdc++


OBJECTS = GlutExample.o
All: GlutExample


GlutExample: GlutExample.o $(OBJECTS)
$(CC) $(FRAMEWORK) $(CFLAGS) -o $@ $(LIBPATH) $(LIBRARIES) $(OBJECTS)

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • makefile error
    2005-04-03 15:06:24  possen [Reply | View]

    Unfortunately the indentation was lost when I posted above, the last line should be indented with a TAB character.