www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/30/05:48:15

Date: Fri, 30 Apr 1999 11:47:12 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <199904300947.LAA19390@acp3bf.physik.rwth-aachen.de>
To: "Fred ---o0o---" <fred DOT le AT laposte DOT fr>
Cc: djgpp AT delorie DOT com
Subject: Re: hard to begin
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B
X-Newsreader: TIN [version 1.2 PL2]
Reply-To: djgpp AT delorie DOT com

In article <7gbg1p$2ub$1 AT oceanite DOT cybercable DOT fr> you wrote:
> C:\djgpp\fred>gcc hellow.c -o hello.exe -v
> Reading specs from c:/mydev/dev-c++/lib/specs

This is almost certainly not the correct 'specs' file to use.

> gcc driver version 2.8.0 executing gcc version 2.8.1

Version mixup within gcc? You really must have screwed your
installation completely.

> c:/djgpp/lib/gcc-lib/djgpp/2.80/cpp.exe -lang-c -v -undef
> -D__GNUC__=2 -D__G NUC _MINOR__=8 -Di386 -D_WIN32 -DWIN32
> -D__WIN32__ -D__MINGW32__ -DWINNT -D_X86_ =1 - D__STDC__=1
[...]

Aha, this clears up some of the mud, then. You have MinGW32 installed
on your box, as well, and you have its environment variables active.
(LIBRARY_PATH, INCLUDE_PATH, or similar, I don't really remember their
names).

That's where your problem roots. If you want to use more than one gcc
port (out of DJGPP, emx, MinGW32, Cygwin, ...) on the same machine,
you must be very careful to isolate them from each other, or you'll be
in serious trouble. Currently, you're trying to build a program with
the DJGPP port of gcc, but using MinGW32 #defines, includes and
libraries. It's a complete mess that cannot possibly work at all.

Unlike the default case, where DJGPP is the only gcc port on the box,
this is a situation where you do *not* want to add the 'set DJGPP=...'
line or the one changing the PATH to autoexec.bat. Likewise, the
settings for the other compilers should also not be moved into
autoexec.bat

Instead, you'll want a separate batch file per compiler suite that
sets up the necessary things, and *another* one that removes those
settings again. That way, you can call 'djgpp.bat' before you start
working in DJGPP, and 'enddjgpp.bat' after you've finished. For Cygwin
and MinGW32, roughly suitable 'startup' batch files are installed with
the packages. A little program that can manipulate the path can be
very handy, in such cases. Without it, it's quite a nuisance to remove
one directory from an existing PATH variable.

A prototype of such batch files for DJGPP could look like this:

--- djgpp.bat ---
@echo off
set DJGPP=c:/djgpp/djgpp.env
apath c:\djgpp\bin

--- enddjgpp.bat ---
@echo off
set DJGPP=
apath -c:\djgpp\bin

Another possibility, since you'll be using Windows anyway: you can
setup separate DOS boxes for each compiler (MinGW32 and Cygwin already
install such modified DOS windows themselves), where the settings are
made separately in the startup batch file of each DOS box.

--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019