Got it to compile on Mac OS X by downloading SDL, SDL_mixer, SDL_image, SDL_ttf, and some weird SDL_gfxPrimitives library, and then doing a hackish compile like this:
Code:
Alcarin:pong steven$ g++ -O2 -std=c++98 -Wall -Wunused -Wundef -pedantic -fno-strict-aliasing -I ../SDL_gfxPrimitives-1.5/ -I /Library/Frameworks/SDL.framework/Headers -I /Library/Frameworks/SDL_mixer.framework/Headers -I /Library/Frameworks/SDL_image.framework/Headers -I /Library/Frameworks/SDL_ttf.framework/Headers -framework AppKit -framework SDL -framework SDL_mixer -framework SDL_image -framework SDL_ttf -o linux/pong.mac ../SDL_gfxPrimitives-1.5/SDL_gfxPrimitives.c *.cpp SDLMain.m
Paddle.cpp: In member function ‘void Paddle::handle_input()’:
Paddle.cpp:46: warning: enumeration value ‘SDLK_UNKNOWN’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_FIRST’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_BACKSPACE’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_TAB’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_CLEAR’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_RETURN’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_PAUSE’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_ESCAPE’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_SPACE’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_EXCLAIM’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_QUOTEDBL’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_HASH’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_DOLLAR’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_AMPERSAND’ not handled in switch
Paddle.cpp:46: warning: enumeration value ‘SDLK_QUOTE’ not handled in switch
[... snip ...]
Paddle.cpp:51: warning: enumeration value ‘SDLK_UNKNOWN’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_FIRST’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_BACKSPACE’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_TAB’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_CLEAR’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_RETURN’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_PAUSE’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_ESCAPE’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_SPACE’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_EXCLAIM’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_QUOTEDBL’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_HASH’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_DOLLAR’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_AMPERSAND’ not handled in switch
Paddle.cpp:51: warning: enumeration value ‘SDLK_QUOTE’ not handled in switch
[... snip ...]
Paddle.cpp:59: warning: enumeration value ‘SDLK_UNKNOWN’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_FIRST’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_BACKSPACE’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_TAB’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_CLEAR’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_RETURN’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_PAUSE’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_ESCAPE’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_SPACE’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_EXCLAIM’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_QUOTEDBL’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_HASH’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_DOLLAR’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_AMPERSAND’ not handled in switch
Paddle.cpp:59: warning: enumeration value ‘SDLK_QUOTE’ not handled in switch
[... snip ...]
Paddle.cpp:64: warning: enumeration value ‘SDLK_UNKNOWN’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_FIRST’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_BACKSPACE’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_TAB’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_CLEAR’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_RETURN’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_PAUSE’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_ESCAPE’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_SPACE’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_EXCLAIM’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_QUOTEDBL’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_HASH’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_DOLLAR’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_AMPERSAND’ not handled in switch
Paddle.cpp:64: warning: enumeration value ‘SDLK_QUOTE’ not handled in switch
[... snip ...]
cc1obj: warning: command line option "-std=c++98" is valid for C++/ObjC++ but not for ObjC
SDLMain.m:8:2: warning: #import is a GCC extension
SDLMain.m:9:2: warning: #import is a GCC extension
In file included from SDLMain.m:9:
SDLMain.h:8:2: warning: #import is a GCC extension
In file included from SDLMain.m:9:
SDLMain.h:11: warning: struct has no named members
SDLMain.m:10:2: warning: #import is a GCC extension
SDLMain.m:11:2: warning: #import is a GCC extension
SDLMain.m:68: warning: struct has no named members
Alcarin:pong steven$
The SDLMain.m warnings are no fault of your own.
So it looks like as far as warnings go, you're just missing a 'default' case on your switch statements in Paddle.cpp on lines 46, 51, 59, 64 (something like 'default: break;' would silence it). So nothing really bad there.
Is your game supposed to have some sort of A.I. controlling the 2nd paddle?