Advertisement

SDL, need help

Started by May 13, 2002 10:35 PM
3 comments, last by Tac-Tics 22 years, 6 months ago
I tried posting this in the turbo forum... unfortunately it seems the forums at the bottom of the page are for display purposes only. They''re pretty deserted. Anyway, I''m trying to get SDL to work with the free Borland Command Line compiler (b/c command line > IDE''s). However, something''s afoot and I can''t quite get it to work. I dLed it, put all the includes in c:\Borland\include\sdl\ and all the libs in c:\Borland\lib\sdl\ But no matter what I do, when I try to compile the example they provide in the help files and I get this... Fatal: Expected an option: Lc:\Borland\lib\sdl ... however, I have it set up in both bcc32 and ilink32 config files to look in that directory. And even when I explicitly tell the thing to look in those directories, it won''t work. Then, sometimes when I''m trying to compile OTHER programs completely unrelated to SDL, it gives me that same error. I don''t know if it doesn''t work with Borland, or I need to do some funny stuff with the SDL.DLL (BTW, what exactly does implib do?). Any help = thnx. "You TK''ed my chicken!"
Read the SDL FAQ
http://www.libsdl.org/faq/FAQ-Win32.html#WIN32_4
Compiling with the Free Borland 5.5 Commandline Compiler
MSN Messenger: Thomas_Szafran@hotmail.com
Advertisement
I followed the advice at
http://www.libsdl.org/faq/FAQ-Win32.html#WIN32_4

This is also a good time to learn how to to use make.exe

"1. Run the IMPLIB utility on SDL.DLL to make a new SDL.LIB import library. Use the -a and -c switches.

2. You still need the SDL_MAIN.LIB file, so that you don''t need to define WinMain() and all that junky windows stuff. You have no .dll file to build this .lib from, and COFF2OMF creates a empty .lib (you can check with TDUMP, another utillity that comes with the compiler). Get the Win32 version of the SDL_main.c file from the source, and dump it in with the rest of your project,

3. Compile your source (including SDL_main.c) into object files using BCC32 with the following compiler options:
-c (Don''t link)
-tW (Create windows app)
-DWIN32 (Define WIN32, this is needed in the SDL_main.h file, and maybe others)

4.Link the.obj files together using ILINK32 with the following options:
-aa (Create windows app, sounds redundant, but...)
-Tpe (Target = windows exe)
-c (case sensitive linking, may be the default...)
and the following additional files (order is important)
sdl.lib (created in step 1)
import32.lib
c0w32.obj
cw32.lib"

I also put the sdl.lib file in the Borland library folder rather than put in another directory into the config file, but that''s just me.
I''ve been trying it and I can get it to compile the object file, but linking is not my forté. I keep getting an unresolved external on WinMain =-( How do I fix this?
I still can''t get it to work. When I try to link the files, I get an unresolved external on WinMain. Then, when I try adding SDLmain.lib to the list to list of files to link, I get an invalid OMF record. I''m so confused and my head is really starting to hurt (I''ve gotten almost nowhere on this for 4 days).
Can anyone help me?

This topic is closed to new replies.

Advertisement