【发布时间】:2012-11-25 17:20:52
【问题描述】:
我正在使用this generic makefile。
使用此自定义选项:
# The pre-processor options used by the cpp (man cpp for more).
CPPFLAGS = -Wall -I/Library/Frameworks/SDL.framework/Headers
# The options used in linking as well as in any direct use of ld.
LDFLAGS = -framework SDL -framework Cocoa -framework OpenGL
# The executable file name.
# If not specified, current directory name or `a.out' will be used.
PROGRAM = app
# The source file types (headers excluded).
# .c indicates C source files, and others C++ ones.
SRCEXTS = .c .C .cc .cpp .CPP .c++ .cxx .cp .m
clean:
$(RM) $(OBJS) $(PROGRAM) $(PROGRAM)
代替:
# The pre-processor options used by the cpp (man cpp for more).
CPPFLAGS = -Wall
# The options used in linking as well as in any direct use of ld.
LDFLAGS =
# The executable file name.
# If not specified, current directory name or `a.out' will be used.
PROGRAM =
# The source file types (headers excluded).
# .c indicates C source files, and others C++ ones.
SRCEXTS = .c .C .cc .cpp .CPP .c++ .cxx .cp
clean:
$(RM) $(OBJS) $(PROGRAM) $(PROGRAM).exe
Here你可以找到我正在运行的makefile的完整版本。
我正在使用带有 gcc 4.2.1 的 Mac OS X 10.6.8,并尝试使用 SDL 和 OpenGL 编译带有 SDLMain.m 和 SDLMain.h 的 main.cpp。
弹出的错误是:
main.d:1: * 缺少分隔符。停下来。
文件 main.d(由 makefile 生成)是这样的:
-n ./
main.o: main.cpp
有什么问题?
【问题讨论】:
标签: c++ opengl gcc makefile sdl