Libraries and Borland's free c++ compiler

Hi all,

I wish to use Borland’s Free C++ Compiler (BCC) to make Windows version
of my game. I have downloaded binaries and source code for various
add-on libraries:

sdl_mixer
sdl_image
sdl_net

But I guess that binaries aren’t compatible with BCC, and source doesn’t
contain any makefiles.

Can you give me some directions… how to build these libraries for BCC?

BTW, sdl_net is the most important to me (I can use just .bmp and .wav
it’s not problem, but don’t know what to use for network if this doesn’t
work).

TIA–
Milan Babuskov
http://fbexport.sourceforge.net

Milan Babuskov wrote:

Hi all,

I wish to use Borland’s Free C++ Compiler (BCC) to make Windows version
of my game. I have downloaded binaries and source code for various
add-on libraries:

sdl_mixer
sdl_image
sdl_net

But I guess that binaries aren’t compatible with BCC, and source doesn’t
contain any makefiles.

Can you give me some directions… how to build these libraries for BCC?

BTW, sdl_net is the most important to me (I can use just .bmp and .wav
it’s not problem, but don’t know what to use for network if this doesn’t
work).

Looks like I’m going to answer to myself again. I tried many things, but
failed to build the library, so I tried with Cygwin, and it works. So, I
guess I’ll be using Cygwin to make Windows version of game.

However, if anyone knows how to do it with BCC, I would appreciate it…–
Milan Babuskov
http://fbexport.sourceforge.net

I wish to use Borland’s Free C++ Compiler (BCC) to make Windows version
of my game. I have downloaded binaries and source code for various
add-on libraries:

sdl_mixer
sdl_image
sdl_net

Uh, I’m currently doing it! Here’s how:

  1. to compile SDL_main.c

    C:\bcc55\bin\bcc32 -M -c -tW -DWIN32 -IC:\BCC55\INCLUDE -I…\DIDLIB\SDL SDL_main.c

  2. to import SDL’s runtimes DLLs

    C:\bcc55\bin\implib -a -c SDL.LIB SDL.DLL
    C:\bcc55\bin\implib -a -c SDL_TTF.LIB SDL_TTF.DLL
    C:\bcc55\bin\implib -a -c SDL_mixer.LIB SDL_mixer.DLL

  3. to link program:

    C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib import32.lib c0

I hope that will help you.

Bye,
Enzo.

Enzo wrote:

I wish to use Borland’s Free C++ Compiler (BCC) to make Windows version
of my game. I have downloaded binaries and source code for various
add-on libraries:

sdl_mixer
sdl_image
sdl_net

Uh, I’m currently doing it! Here’s how:

  1. to compile SDL_main.c

    C:\bcc55\bin\bcc32 -M -c -tW -DWIN32 -IC:\BCC55\INCLUDE -I…\DIDLIB\SDL SDL_main.c

  2. to import SDL’s runtimes DLLs

    C:\bcc55\bin\implib -a -c SDL.LIB SDL.DLL

So far it’s ok, since I build SDL.lib and SDL_main.lib from source.

C:\bcc55\bin\implib -a -c SDL_TTF.LIB SDL_TTF.DLL
C:\bcc55\bin\implib -a -c SDL_mixer.LIB SDL_mixer.DLL

This works.

  1. to link program:

    C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib import32.lib c0

The linker complains that it cannot find c0.obj ?
If I throw that out, the program compiles and links, but crashes.

I have managed to compile and run program that uses just SDL and
SDL_main libraries, but I don’t know how to add other libs.

Here’s how pure SDL works:
bcc32 -DWIN32 -tW -Tpe -L. test1.cpp sdl.lib sdlmain.lib

So, I linked sdl_mixer.lib too, and when I try to run it, this message
pops-up:

“The SDL_MIXER.DLL file is linked to missing export
SDL.DLL:SDL_RWFromFP”–
Milan Babuskov
http://fbexport.sourceforge.net

  1. to link program:

C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib
import32.lib c0

The linker complains that it cannot find c0.obj ?
If I throw that out, the program compiles and links, but crashes.

Woooops!!! Cutting and pasting I’ve removed part of the line, the correct is:

C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib import32.lib c0w32.obj cw32.lib sdl_ttf.lib sdl_mixer.lib

Sorry for the mistake. :wink:
Bye,
Enzo.

Enzo wrote:

  1. to link program:

C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib
import32.lib c0

The linker complains that it cannot find c0.obj ?
If I throw that out, the program compiles and links, but crashes.

Woooops!!! Cutting and pasting I’ve removed part of the line, the correct is:

C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib import32.lib c0w32.obj cw32.lib sdl_ttf.lib sdl_mixer.lib

Sorry for the mistake. :wink:

Thanx, I’ll try it, but never mind. I managed to build everything with
Cygwin, and I have almost finished my game.–
Milan Babuskov
http://njam.sourceforge.net

Enzo wrote:

Woooops!!! Cutting and pasting I’ve removed part of the line, the correct is:

C:\bcc55\bin\ilink32 -LC:\BCC55\LIB -aa -Tpe -c myprog.obj sdl.lib import32.lib c0w32.obj cw32.lib sdl_ttf.lib sdl_mixer.lib

Sorry for the mistake. :wink:
Bye,
Enzo.

Well, I made it. Thanx for the help. it works now.

I have also noticed few things:

  • binaries built with Borland’s free compiler (BCC) are a lot smaller
    (80 kB with BCC, 502 kB with gcc 3.2 on Cygwin)

  • DLLs built with VC (vs Cygwin) are a lot smaller too and run faster…
    Using the same game with Cygwin DLLs runs at about 110 fps, and about
    280 with VC dlls.

  • It possible to use VC DLLs with Cygwin .exe, but don’t use 44100 sound
    output (makes a lot of noise), but rather 22050 (some of the sounds may
    still be a little distorted but only noticeable to sensitive ear). I’m
    100% sure it’s not the weak machine (P3 at 1GHz just playing music
    without any graphics stuff + works ok with Cygwin DLLs)

  • One more point for Borland: compiler nicely traps some common
    programming-logic errors and issues warnings while gcc doesn’t.

Bye,–

Milan Babuskov
http://njam.sourceforge.net

I also use the BCC compiler and IMHO it’s far better then VC. I always use
console projects with SDL which works just fine.
So i recommend BCC to VC users :wink: BCC also follows the ANSI and ISO
standards where VC does not.--------------------------------
| Dinand Vanvelzen, |
| Programmer, |

Software Engineering student

----- Original Message -----
From: albis@eunet.yu (Milan Babuskov)
To:
Sent: Monday, June 09, 2003 12:01 PM
Subject: Re: [SDL] Libraries and Borland’s free c++ compiler

Well, I made it. Thanx for the help. it works now.

I have also noticed few things:

  • binaries built with Borland’s free compiler (BCC) are a lot smaller
    (80 kB with BCC, 502 kB with gcc 3.2 on Cygwin)

  • DLLs built with VC (vs Cygwin) are a lot smaller too and run faster…
    Using the same game with Cygwin DLLs runs at about 110 fps, and about
    280 with VC dlls.

  • It possible to use VC DLLs with Cygwin .exe, but don’t use 44100 sound
    output (makes a lot of noise), but rather 22050 (some of the sounds may
    still be a little distorted but only noticeable to sensitive ear). I’m
    100% sure it’s not the weak machine (P3 at 1GHz just playing music
    without any graphics stuff + works ok with Cygwin DLLs)

  • One more point for Borland: compiler nicely traps some common
    programming-logic errors and issues warnings while gcc doesn’t.

Well, I made it. Thanx for the help. it works now.

I have also noticed few things:

  • binaries built with Borland’s free compiler (BCC) are a lot smaller
    (80 kB with BCC, 502 kB with gcc 3.2 on Cygwin)

Are you sure you’ve stripped the binaries ? Gcc leaves debugging information
in the binaries if you don’t run “strip progname.exe” after it’s been
compiled…

  • DLLs built with VC (vs Cygwin) are a lot smaller too and run faster…
    Using the same game with Cygwin DLLs runs at about 110 fps, and about
    280 with VC dlls.

  • It possible to use VC DLLs with Cygwin .exe, but don’t use 44100 sound
    output (makes a lot of noise), but rather 22050 (some of the sounds may
    still be a little distorted but only noticeable to sensitive ear). I’m
    100% sure it’s not the weak machine (P3 at 1GHz just playing music
    without any graphics stuff + works ok with Cygwin DLLs)

The code quality from gcc is normally pretty good - are you sure you’ve
switched optimisation on ? The default target is non-optimised with gcc/g++.
You need to add “-O3” (Oh, not zero) to the compile-time flags. The fact
that you’re finding the binaries large makes me suspicious that you’re not
optimising the code as well - Optimised code is normally significantly smaller
as well as significantly faster…

  • One more point for Borland: compiler nicely traps some common
    programming-logic errors and issues warnings while gcc doesn’t.

This doesn’t surprise me :slight_smile:

The best compiler I ever came across was the Vax C compiler, which used to
warn you when it found an error, then fix it if it could (missing
semicolons, stuff like that) during compile :slight_smile: Gcc is from the ‘do this,
and do only this’ school of thought …

ATB,
Simon

SDL identity wrote:

  • binaries built with Borland’s free compiler (BCC) are a lot smaller
    (80 kB with BCC, 502 kB with gcc 3.2 on Cygwin)

Are you sure you’ve stripped the binaries ? Gcc leaves debugging
information in the binaries if you don’t run “strip progname.exe”
after it’s been compiled…

Well, I’m really new to gcc, so I didn’t know about this. Now the .exe
is just about 90kB… :slight_smile:

  • DLLs built with VC (vs Cygwin) are a lot smaller too and run
    faster… Using the same game with Cygwin DLLs runs at about 110 fps,
    and about 280 with VC dlls.

The code quality from gcc is normally pretty good - are you sure
you’ve switched optimisation on ? The default target is non-optimised
with gcc/g++.
You need to add “-O3” (Oh, not zero) to the compile-time flags. The
fact that you’re finding the binaries large makes me suspicious that
you’re not optimising the code as well - Optimised code is normally
significantly smaller as well as significantly faster…

Didn’t know about that either.

Now I built new .dll and my .exe with -O3 flag (it was -O2 before). The
game runs about 10% faster and of course the music still sounds good.

Can I also strip the .dll? I tried and it’s only about 280 kB now.

I guess I’ll build my .exe with BCC and SDL DLLs with Cygwin to get the
best results.

Thanx for advices.–
Milan Babuskov
http://njam.sourceforge.net