Hi all
I'm writing my own little Game Engine. It is basically just a good collection of classes that will do things like state management, resource management, some graphics functions, etc.
I like to compile my code once in a while, just to see if I'm doing things that are not totally bogus. However, seeing I am just writing a collection of classes and functions, and there is no
int main() function, my compiler keeps throwing fesces at me :(
I would like to know what options to pass to my compiler in order for it to just compile the code, but not try to create a single binary from it. (I am not very familiar with the terms linking, compiling, assembling).
This is my makefile:
# Hardcoded Makefile
# TODO: Make a nice python script
CC = g++
CFLAGS = `sdl-config --cflags --libs`
OBJS = engine.o gfx.o log.o
r2e : $(OBJS)
$(CC) $(OBJS) $(CFLAGS)
engine.o : R2e/engine.cpp R2e/engine.h R2e/log.h R2e/state.h R2e/gfx.h
$(CC) -c R2e/engine.cpp
gfx.o : R2e/gfx.cpp R2e/gfx.h R2e/engine.h
$(CC) -c R2e/gfx.cpp
log.o : R2e/log.cpp R2e/log.h
$(CC) -c R2e/log.cpp
clean :
rm -f *.o
rob@rob-laptop:~/Development/R2e$ make r2e
g++ -c R2e/engine.cpp
g++ -c R2e/gfx.cpp
g++ -c R2e/log.cpp
g++ engine.o gfx.o log.o `sdl-config --cflags --libs`
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [r2e] Error 1