Slow start with Borland's free compiler

Hello.

I have been unable to build the SDL with the Borland’s free C++
compiler. Here are the steps I took:

  1. Downloaded the SDL 1.2.5 source code.
  2. Extracted the ZIP file into a directory.
  3. Opened and read the \Borland.html.
  4. Extracted the \Borland.zip file into , as
    instructed on the HTML document; this created a \Borland
    subdirectory.
  5. Opened a command prompt and changed the directory to
    \Borland\freebcc.
  6. Ran Borland’s make utility to build the SDL:
    make -f SDL.mak

Unfortunately, this is what I got:----------------
Borland C++ 5.5.1 for Win32 Copyright © 1993, 2000 Borland
…\src\SDL_error.c:
Error E2021 …\include\SDL_types.h 95: Array must have at least one
element
*** 1 errors in Compile ***
…\src\SDL_fatal.c:
Error E2021 …\include\SDL_types.h 95: Array must have at least one
element
*** 1 errors in Compile ***
…\src\SDL.c:
Error E2021 …\include\SDL_types.h 95: Array must have at least one
element
*** 1 errors in Compile ***

I have tried looking at the indicated source files, but could not spot
what exactly was causing the error. I tried the FAQ on SDL’s Web site
and found an item regarding the need to make sure the compiler is
treating enums as int, but this seems to be taken care of by the make
files already, as I saw the ‘-b’ option there and as it also shows up in
the final command line.

I was very sad to find problems so early, since I was hoping to make a
good start at SDL. Has anybody else faced this problem? I would think
everybody using the Borland’s free compiler should face the same thing,
but in any case I will try starting everything from scratch, including
redownloading the compiler and the SDL source. In the meantime, I would
be really happy if somebody has some tips or suggestions on what I might
have done wrong or missed.

For what it is worth, I am running Windows XP (SP2) on a P4 1.7GHz.

Thank you,


Ney Andr? de Mello Zunino
Campus Computing Centre
United Nations University

I was very sad to find problems so early, since I was hoping to
make a
good start at SDL. Has anybody else faced this problem? I would
think
everybody using the Borland’s free compiler should face the same
thing,

What would you want to compile the SDL source code? You can already
download an SDL.DLL from www.libsdl.org, so just use that. You
will have to generate a new .LIB file for Borland C++, though,
just like the FAQ says. I have used SDL and Borland together without
problems. (Unless you plan to use OpenGL, in which case you need to
disable floating point exceptions.)–
Matthijs Hollemans
www.allyoursoftware.com

Matthijs Hollemans wrote:

What would you want to compile the SDL source code? You can already
download an SDL.DLL from www.libsdl.org, so just use that. You
will have to generate a new .LIB file for Borland C++, though,
just like the FAQ says. I have used SDL and Borland together without
problems. (Unless you plan to use OpenGL, in which case you need to
disable floating point exceptions.)

Yes, I noticed I could have downloaded the DLL and libs, but I wanted to
have the full download, so I could have the test files, etc. In
addition, I thought that being able to build the SDL and those test
files would be a way for me to know my setup is fine. As for you remark
on OpenGL, I do intend to use it with SDL.

Back to the original problem, I have found its cause. The .mak files
actually use ‘-b-’ (instead of ‘-b’) which effectively turns off the
"enums as int" option. I had to edit the mak file to fix the problem.
Sorry for having overlooked that in my previous message.

Anyway, I would like to suggest that the mak files for Borland were
updated to make sure the ‘-b’ flag is not turned off. As I found out,
the same is true for all the other mak files in the directory. While we
are at that, I experienced some other problems

As it turns out, I encountered some other issues with the mak files. I
will now summarize them, so that they may be fixed and new users will
not have to face the same thing:

  • The compiler flag ‘-b-’ should be changed to ‘-b’.
  • There are currently compiler flags for precompiled headers which
    point to a hardcoded path, possibly the one used by the author of
    the mak files. I think they should be removed altogether.
  • After fixing the two above issues, an attempt to build any of the
    test applications will fail because the Borland’s “packages” which
    are referred to from the mak files cannot be found (as far as I
    know, they are only available with the IDE version). To overcome
    this, I had to modify the mak files again and remove the $(PACKAGES)
    variable from the ALLOBJ definition, so that the compiler would not
    try to look for packages.
  • With the above, the test applications seem to build fine; however,
    they will fail at runtime, with a “entry point not found” error
    message (e.g. for testwin.exe, the message is "The procedure entry
    point SDL_Delay could not be located in the dynamic link library
    SDL.DLL.) Notice that the DLL is in the same directory of the
    testwin.exe file, so it is not a matter of a wrong version of it
    being loaded.

It would be really nice if the above issues could be taken care of and
the updated version of the files could be put into the downloadable
files. I will be happy to help, if anything is up to me and my limited
knowledge.

Thank you,–
Ney Andr? de Mello Zunino
Campus Computing Centre
United Nations University