delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/31/05:23:07

Date: Fri, 31 Jul 1998 12:17:27 +0300
From: Alexander Bokovoy <bokovoy AT bspu DOT unibel DOT by>
Reply-To: Alexander Bokovoy <bokovoy AT bspu DOT unibel DOT by>
Organization: BSPU named after Maxim Tank
Message-ID: <10512.980731@bspu.unibel.by>
To: djgpp AT delorie DOT com
Subject: Re: Saving gcc's messages
References: <35c476e4 DOT 79147412 AT nntp1 DOT best DOT com>
Mime-Version: 1.0

Hi Mike,
31.07.98, you wrote:
> Here's a simple question (I hope). When I run gcc from the
> command-line in a DOS shell, the compiler messages (warnings and
> errors) are printed on the screen. When I try to redirect these, as
> in:
>gcc -c test.c >> err.txt
> It doesn't work- err.txt stays empty, and the errors are still printed
> on the screen.
> I checked the gcc options, and didn't see any way of directing the
> messages into a file.
> Please let me know if I can do this- or if not, if I can do it instead
> with the "make" utility (which I haven't tried yet)...
DJGPP distribution has a special command redir (in
djgpp/bin/redir.exe) which is suitable
for such work:
redir.exe -e error.txt -o output.txt <program-to-execute [options]>
    -e error.txt - save content of stderr to error.txt
    -o output.txt - save content of stdout to output.txt
In your case it will be:
redir.exe -e err.txt gcc -c test.c

Regards,
Alexander Bokovoy, <bokovoy AT bspu DOT unibel DOT by>
--=== The Soft Age coming soon ===--



- Raw text -


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