Board index » cppbuilder » Re: BC++ And BCBuilder at same time

Re: BC++ And BCBuilder at same time


2003-11-29 11:40:46 AM
cppbuilder64
"David Patte" < XXXX@XXXXX.COM >wrote in message
Quote
I have both Borland C++ 5.02 with patch1
and BCB 5 with patch 1
both installed on my machine

I notice that my path in my autoexec.bat indicates paths all my borland
products (including these two)

Since BCC32.exe and a few other files are on both paths, but different
files, will it choose the correct .exe when I alternate between these
two compilers?
They will work fine if you only use the IDE's. But if you are using the
command-line compilers, then the first one in the path will always take
precedence. On my system, the BCB path is first (because I use it most), so
when I generate makefiles for my old BC++ 5.02 projects, I always specify an
explicit path to the compiler. For example, in my BC++ 5.02 makefiles, I
always change from:
BCC32 = Bcc32 +BccW32.cfg
to:
BCC32 = c:\bc5\bin\Bcc32 +BccW32.cfg
because if I don't, MAKE will try to use the BCB compiler, which won't work
on my BC++ 5.02 projects.
- Dennis
 
 

Re:Re: BC++ And BCBuilder at same time

David Patte < XXXX@XXXXX.COM >wrote:
Quote
I have both Borland C++ 5.02 with patch1 and BCB 5 with patch 1 both
installed on my machine. I notice that my path in my autoexec.bat
indicates paths all my borland products (including these two)
Since BCC32.exe and a few other files are on both paths, but
different files, will it choose the correct .exe when I alternate
between these two compilers?
Not reliably, so you better avoid such a mixup.
The best way I've found is to set *none* of the installed compiler
toolchains' environment variables directly in autoexec.bat, because
whatever choice you make there will be wrong for the majority of them
as soon as you have more than two, anyway.
Instead, have a central "batches" directory in the PATH, and a tool
that lets you both add and *remove* entries from the PATH, the tool
itself installed in a directory on the PATH (I use a freeware from the
Simtel.Net DOS collection).
Proceed by writing a pair of batch files in "batches" per toolchain to
"enable" and "disable" it, respectively. These batch files should
prepend the toolchain's entries to the PATH, and remove them again,
respectively, and create/change/remove environment variables, while at
it.
That way, you can type "en_b5.bat" (or use it as the startup batch
file in a desktop link for a "bc++5.02 shell") to have a command line
environment fit for use with C++ 5.02, and "dis_b5.bat" to turn it all
off again. For good measure, change the PROMPT, too, so it's always
obvious which mode of operation the shell is currently in.
This kind of setup may feel like a pain in the lower back at first,
but it more than pays off in the long run, especially if you have
considerably more than two toolchains available (I have roughly 10
altogether). If you find you routinely use one compiler much more
than the others, you can still call up its enabler batch at the end of
autoexec.bat for convenience.
--
Hans-Bernhard Broeker ( XXXX@XXXXX.COM )
Even if all the snow were burnt, ashes would remain.