Okay. Well, I never actually got the SDL working properly with Dev-C++. The closest I came is this: http://dwks.theprogrammingsite.com/m...ilseas/Makewin. That is, passing "-lSDL.dll -lSDL -lSDLmain" to the command line. But it means that you have to use WinMain() instead of main(). For portability with Linux systems, I usually go
Code:
#ifdef WIN32
INT STDCALL WinMain(...) {
#else
int main(int argc, char *argv[]) {
#endif
However, these days I compile my SDL programs with MinGW 3.4.2 from the command line. Here's a Makefile (I call the Windows versions Makewin, as you may have noticed, and use make.bat which calls make.exe -f Makewin) from a recent project (Sail the Seas is ancient):
Code:
# Makefile for snip, Windows version
SDLLIBPATH = C:/Dev-C_~2/Lib
SDLINCPATH = C:/Dev-C_~2/Include/SDL
CC = gcc
CFLAGS = -W -Wall -ansi -pedantic -O2 -I$(SDLINCPATH) -L$(SDLLIBPATH)
CLINK = -lm -lSDL.dll -lSDL -lSDL_image -lSDL_gfx
OBJ = dsfont.o graphics.o main.o menu.o
TARGET = snip.exe
# Default target: all
all: $(TARGET)
# Executable files
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -s -o $(TARGET) $(OBJ) $(CLINK)
debug: $(OBJ)
$(CC) $(CFLAGS) -g -o $(TARGET) $(OBJ) $(CLINK)
# Source files
dsfont.o: includes.h dsfont.h graphics.h
graphics.o: includes.h dsfont.h graphics.h
main.o: includes.h dsfont.h graphics.h main.h
menu.o: includes.h dsfont.h graphics.h menu.h
# Other targets
run: $(TARGET)
./$(TARGET)
runa: $(TARGET)
./$(TARGET) `line`
rundebug: debug
gdb ./$(TARGET)
clean:
-rm $(TARGET) $(OBJ)
(It's not actually called snip, I just removed the program's real name.)
In other words, my linker options are -lm -lSDL.dll -lSDL -lSDL_image -lSDL_gfx, or -lSDL.dll -lSDL without the extra libraries.
With that Makefile and the command-line MinGW 3.4.2, I can use int main(int argc, char *argv[]) in Windows and Linux.
I don't know how things would stand with the latest version of Dev-C++ (I use an old version), or Code::Blocks. I imagine my latest version would work. -lSDL.dll -lSDL.
Anyway, try something like that and see what happens. Throw in -lSDLmain. There's only 3! + 2! + 1! = 6 + 2 + 1 = 9 possible combinations, after all.