www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/19/07:59:50

Date: Tue, 19 Jun 2001 14:58:37 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Adam Majer <adamm AT galacticasoftware DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Help compiling files.
In-Reply-To: <3B2ED0C9.A9BDCBE6@galacticasoftware.com>
Message-ID: <Pine.SUN.3.91.1010619145441.9255B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 18 Jun 2001, Adam Majer wrote:

> >   gcc -c -I"..\include;..\include\gl"  api_arrayelt.c
> 
> This is what I've been using with Borland's free compiler for Win32 and
> it worked for a long time like this...

But gcc isn't Borland's compiler, so what worked for Borland might not 
work for gcc.

It could have ``worked'' because gcc never actually needed to look into 
one of these directories.

Also, since your original message said that the above didn't work at all 
in a Makefile, I wonder what does ``work'' mean at all.

> > Btw, does -I really accept multiple directories like that?  As far as
> > I can tell from GCC docs, it can only accept a single directory.  So
> > what you really should do is modify the command like this:
> > 
> >   gcc -c -I..\include -I..\include\gl  api_arrayelt.c
> 
> Apparently DJGPP wants directories like above and in quotation marks :)

If you don't use the semi-colon (or other characters special to the shell 
or to Make), then you don't need any quotes.

> For instance, I just noticed that if you compile
> 
> gcc my_dir\file.c
> 
> and file has
> 
> #include "local_include.h"
> 
> where local_include.h is in the . directory, you must specify -I".\" as
> otherwise the compiler will switch directory to my_dir and not find the
> local_include.h  Don't know if that is the way it's suppose to be...

Yes, that's how it is supposed to work.  When the compiler sees 
"local_include.h", it searches in the directory where the source file 
lives.

- Raw text -


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