From: mhahn AT esoc DOT esa DOT de (Markus Hahn) Subject: Re: Warnings/Errors loging To: gmoscho AT alexander DOT cc DOT ece DOT ntua DOT gr (George C. Moschovitis) Date: Fri, 23 Jun 1995 16:23:49 +0000 (GMT) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu > > Hi 2 all, > > i was trying to get the compilation errors/warnings logged to a file but didnt > succed. i tried standart dos redirection (like gcc test.c > error.log) but that strangely didnt work. Is there a specific switch for this or how can i make redirection work ? > > > tmL- > Hi George, wish I had your problems. But ist's true, every problem that arises is the next one to be solved. (I discovered this on my own !) While it NEEDN'T solve your problems (of course not), it is still a good idea to look across the frequently asked questions (respectively to the answers !), supplied with the docs. djgpp/docs/djgpp/djgpp.faq It's quite a good repository and somewhat entertaining as well. I've worked it through and found many useful answers I yet didn't have discovered the questions. You have to tell the compiler to send the error messages to stdout first, before redirecting stdout to some file. set GO32=2r1 Then gcc prog.c > err_file will work as you expect it to. Hope you will find the hint helpful. djgpp.faq >>------------------------------------------------------------ 6. when the compiler ... (approximately line ~587) Q: I want to read all the error messages that gcc throws on me, but they are so many that I can't keep up. How can I redirect them to a file? Q: When I add ``-v'' to the gcc command line, how can I put all the voluminous output into a file, so I don't miss anything when reporting a problem? Q: I have this nitty-gritty graphics program which bombs from time to time, but the registers and traceback info is hidden by the graphics display. How can I see it? A: There are several alternatives: 1) You can put ``2r1'' into your GO32 environment variable, which will redirect stderr to stdout and redirect stdout to a file by appending ``> file''to your command line. When you run gcc in such a manner, this has a disadvantage of feeding possible cpp errors to cc1/cc1plus, which will totally confuse the compiler. 2) You can use a shell smarter then COMMAND.COM, such as 4DOS, which knows how to redirect standard error stream to a file. 4DOS is shareware and can be found, e.g., on SimTel mirrors. 3) You can add ``core [file]'' to your GO32 environment variable, to have your traceback written to the named file. This only works for the exception traceback redirection (useful when running graphics applications). 4) You can run your program under any one of the programs which save the output of programs they spawn on a file. I suggest using a program called SCRIPT, which is similar to its Unix namesake. It has an advantage of saving everything which goes to screen AND showing it on the screen at the same time. SCRIPT can be found on SimTel mirrors as SCRIPT11.ZIP (e.g., oak.oakland.edu:/SimTel/msdos/screen/script11.zip). Wish you many lucky hours with your application and always a friend at the rigth time ! Good by for this time. Marcus P.S. Dare have a look at the questions I have bombt to the list.