Originally Posted by
sharpdust
What compiler are you using?
I get the following when I try to compile your code
Code:
gcc engine.C
engine.h:11: error: 'SDL_Event' has not been declared
engine.h:12: error: 'SDL_Event' has not been declared
distcc[21685] ERROR: compile engine.C on localhost failed
gcc version 4.4.3 20100316 (prerelease) (GCC)
okay, now I'm *REALLY* confused
Code:
[weezer@dev]~/projects/playtheorycpp: g++ main.cpp engine.cpp window.cpp extractor.cpp point.cpp surface.cpp -o bgame `sdl-config --cflags --libs` -lGL -Wall -ansi -pedantic -g3 -ggdb
main.cpp: In function ‘int main(int, char**)’:
main.cpp:201: warning: comparison between signed and unsigned integer expressions
main.cpp:207: warning: comparison between signed and unsigned integer expressions
main.cpp:212: warning: comparison between signed and unsigned integer expressions
In file included from engine.cpp:1:
engine.h:12: error: ‘SDL_Event’ has not been declared
engine.h:13: error: ‘SDL_Event’ has not been declared
[weezer@dev]~/projects/playtheorycpp: make
g++ -ggdb -g3 `sdl-config --cflags` -c main.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c surface.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c window.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c blob.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c point.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c extractor.cpp
g++ -ggdb -g3 `sdl-config --cflags` -c engine.cpp
engine.cpp:11: error: no ‘void Engine::run()’ member function declared in class ‘Engine’
make: *** [engine.o] Error 1
It gives the correct error when I build by hand, but not make.
fwiw
Code:
CC = g++ -ggdb -g3
CFLAGS = `sdl-config --cflags`
LIBS = `sdl-config --libs` -lGL
bgame : main.o surface.o window.o blob.o point.o extractor.o engine.o
$(CC) main.o surface.o window.o blob.o point.o extractor.o engine.o $(LIBS) -o bgame
main.o : main.cpp surface.h window.h point.h extractor.h engine.h
$(CC) $(CFLAGS) -c main.cpp
surface.o : surface.cpp surface.h
$(CC) $(CFLAGS) -c surface.cpp
window.o : window.cpp window.h
$(CC) $(CFLAGS) -c window.cpp
blob.o : blob.cpp blob.h surface.h
$(CC) $(CFLAGS) -c blob.cpp
point.o : point.cpp point.h
$(CC) $(CFLAGS) -c point.cpp
extractor.o : extractor.cpp extractor.h
$(CC) $(CFLAGS) -c extractor.cpp
engine.o : engine.cpp engine.h
$(CC) $(CFLAGS) -c engine.cpp
clean:
rm -rfv *~ *.o
Bookmarks