Hi all,
I have set up Eclipse + CDT on an Arch 2010.05 install. I set up an eclipse project and added SDL as a dependency (see below):
Project -> Properties
* -> GCC C++ Compiler -> Preprocessor -> main=SDL_main
* -> GCC C++ Linker -> Libraries -> SDLmain SDL (in that order top to bottom)
* -> GCC C++ Linker -> Libraries -> Library Search Path -> /usr/lib/ (I verified that libSDL.a and libSDLmain.a are there)
This is the code I'm compiling. It's designed to just be a hello world style SDL app to see that everything is working.
Code:
#include <SDL/SDL.h>
int main(int argc, char **argv)
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return 0;
}
But when I compile I get this error:
Code:
Building target: client
Invoking: GCC C++ Linker
g++ -L/usr/lib/ -o"client" ./src/engine/CEngine.o ./src/engine/main.o -lSDLmain -lSDL
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [client] Error 1
Anyone know how to set up Eclipse + CDT + SDL properly?