This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: gcc problem




On Tue, 21 Oct 1997, Colin Peters wrote:

> Frank Packenham[SMTP:Etc@Weirdness.com] wrote:
> >Well the install seemed to go well, but when I try to compile ( or make )
> >anything this is the result.
> >
> >bash$ gcc laws.c
> >Borland C++ Preprocessor Version 4.00 Copyright (c) 1993 Borland
>  ^^^^^^^
> >International
> >Error: Incorrect command line option: -undef
> >gcc: Internal compiler error: program cpp got fatal signal 1
> >
> 
> The problem, mainly, is that gcc is expecting to call the GNU version of
> cpp, and it's getting the Borland version (you have a Borland compiler
> installed, correct?). Cpp is the preprocessor, and it gets passed many
> options you give on the gcc command line, as well as lots of options
> internal to the two. Obviously Borland's cpp, while a program with the
> same purpose, doesn't have the same command line syntax, and nothing
> works.
> 
> Solutions include:
> 
>  - Setting up your environment so GNU cpp is earlier on the path and/or
>    Borland's is not. You might do this with a pair of batch files or
>    shell scripts for switching between "environments" (I like to set
>    up icons which run the correct batch file and start a dos shell in
>    such circumstances).
> 

This will, however, prevent Borland's compiler from working, as it will
then try to access the GNU cpp instead of its own.

I've run into many similar clashes between $PATH and other environment
variables.  The solution I have evolved is this:

In autoexec.bat, set up a baseline path that does not include ANY of the
conflicting programs' binary directories:

  PATH c:\bin;c:\windows;...and so on...
  SET BASEPATH=%PATH%

Then set up a series of utility batch files to augment the path with the
binary directories for a given program.  For example, I have usegcc.bat:

  @PATH h:\gnuwin32\b18\H-i386-cygwin32\bin;h:\gnuwin32\b18\tcl\bin;%BASEPATH%
  ... may wish to set other gcc environment variables here instead of in
      autoexec.bat ...

and I have usebcc.bat:

  @PATH h:\bcwin32\bin;%BASEPATH%

and a similar script for Visual C++.


Then I can simply type
  usegcc
or 
  usebcc
at an MSDOS prompt before starting to work with any compiler.



For enthusiasts of double-click program launching, create a batch file
like
   usebcc
   bcw
and bind that, rather than the bcw program itself, to the Borland .ide 
file type.


Steve Zeil


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]