engine/main.cpp:
#include "pch.h"
void quit() {
SDL_ShowCursor(1);
SDL_quit();
exit(0);
}
SDL_Surface *screen = NULL;
int scrw = 640, scrh = 480;
int main(int argc, char **argv) {
#define log(s) puts("initializing " s)
log("SDL");
if (SDL_Init(SDL_INIT_VIDEO)) {
puts("Unable to initialize SDL!");
}
log("Video");
screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
if (screen==NULL) {
puts("Unable to create OpenGL screen!");
}
log("Misc");
SDL_WM_SetCaption("game engine", NULL);
SDL_ShowCursor(0);
log("Main Loop");
SDL_event event;
bool done = false;
while (!done) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = true;
} else if (event.type == SDL_KEYDOWN) {
if (event.key.keysym.sym == SDLK_ESCAPE) {
done = true;
}
}
}
}
quit();
return 0;
}
shared/pch.h:#include <math.h> #include <string.h> #include <stdio.h> #include <SDL.h> #include <SDL_opengl.h> #include <GL/glext.h>Makefile:
CXX = g++ CXXOPTFLAGS = -Wall -fsigned-char -O3 -fomit-frame-pointer CXXFLAGS = $(CXXOPTFLAGS) -I. -Iengine -Ishared `sdl-config --cflags --libs` -lGL -lGLU OBJS = engine/main.o default: all all: $(OBJS) $(CXX) $(CXXFLAGS) -o game_engine $(OBJS)I figured it had something to do with `sdl-config --cflags --libs`, so I replaced it with -lSDL, but it spit literally hundreds of errors at me. I understand this may seem like a really stupid problem, and I'm sorry to waste your time. But, can anyone tell me what the problem is?
Thanks!












