gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > GCC Compiler

#2460 - RBurton - Tue Feb 04, 2003 11:29 am

Hi.

I am currently writing my IDE and tool set for Gameboy coding, The current problem is obtaining the output (error listings etc) from the compiler into a text file so I can manipulate it from there.

Compilere from the dos prompt and using the standard dos '>' to redirect output to a file does not redirect all the output.

Any help with this is appreciated.

#2461 - Torlus - Tue Feb 04, 2003 11:55 am

This works on Windows XP :

your_command >a1 2>a2

You get "stdout" in file "a1" and "stderr" in "a2" file. It seems that Windows command-line is getting more and more Unix-compliant :)
I don't think it works on earlier versions of Windows.

#2474 - tepples - Tue Feb 04, 2003 4:25 pm

Torlus wrote:
I don't think [Windows XP's clone of the UNIX system's way of redirecting stderr] works on earlier versions of Windows.

2>err.txt to redirect standard error has worked in all versions of Microsoft Windows NT since NT 4.0, as part of its (rather weak) POSIX command support in cmd.exe. (POSIX was the first document from IEEE to specify how a UNIX system was supposed to behave.) It works fine on my Windows 2000 (NT 5.0) machine.

And if you want to redirect stderr under command.com (the shell from Windows 9x), you can do that as well. Use the redir.exe tool included with the DJGPP compiler.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.