How do I setup my Borland C++ 5.01 for SDL?

Anyone who has time for an stupid question?
I have sofare successfully compiled all my SDL programs in VisualC++ 6.0 but
I would rather use Borlands IDE.
How can I exactly setup Borland C++ 5.01 so that I can compile my SDL
applications - anyone?

thanx - JB_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Why not use OpenWatcom ?

Tom> ----- Original Message -----

From: klfyx@hotmail.com (James Anderson)
To:
Sent: Wednesday, November 14, 2001 8:14 PM
Subject: [SDL] How do I setup my Borland C++ 5.01 for SDL?

Anyone who has time for an stupid question?
I have sofare successfully compiled all my SDL programs in VisualC++ 6.0
but
I would rather use Borlands IDE.
How can I exactly setup Borland C++ 5.01 so that I can compile my SDL
applications - anyone?

thanx - JB


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

“flkajdslfajfldfjdalsfj fljdlaskfjdaslkfjdsalk” writes:

Anyone who has time for an stupid question?
I have sofare successfully compiled all my SDL programs in VisualC++ 6.0 but I
would rather use Borlands IDE.

How can I exactly setup Borland C++ 5.01 so that I can compile my SDL
applications - anyone?
You can use two borland utils implib and coff2omf to create borland
comptible libs from vc++ lib or dll.
“implib SDL_Bcc55.lib SDL.dll” - will create SDL_Bcc55.lib from SDL.dll
"coff2omf SDL.lib SDL_Bcc55.lib" - will create SDL_Bcc55.lib from VC++
SDL.lib

You can use this SDL_Bcc55.lib to link with your applications. Here’s
a sample makefile (in debug mode).

BASE_DIR =
CC = $(BASE_DIR)\bin\bcc32
LINK = $(BASE_DIR)\bin\ilink32
SDL_INCLUDE = \include
SDL_LIB = \lib
CC_FLAGS = -I$(BASE_DIR)\include -I$(SDL_INCLUDE) -c -tWM -v
LINK_FLAGS = -L$(BASE_DIR)\lib -L$(SDL_LIB) /Gn/c/x/aa/Tpe /v

main.exe: main.obj
$(LINK) $(LINK_FLAGS) c0w32.obj+ main.obj, main.exe, import32.lib+ cw32mt.lib SDL_Bcc55.lib
main.obj: main.c
$(CC) $(CC_FLAGS) main.c

clean:
del main.exe
del *.obj

If you make it like this you will get linker error -
‘Unresolved external WinMain’. That’s because we didn’t link to
SDLmain.lib. I’ve tried to coff2omf on it - but it fails to create
valid omf lib. Three options there:

  • find SDLmain.lib for Bcc55 (I heard there’s one - but dunno where
    it is exactly)
  • compile SDL_main.c from sources
  • or just add this four lines to your project

int __stdcall WinMain(long, long, char *, int)
{
return main(__argc, __argv);
}

I always used third variant - and I know that’s evil - you can try
other options.–
Ed Sinjiashvili