LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2008, 05:10 PM   #1
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Recording Compiler Errors


Hello,

I was just working on a program and I went to compile it and I got a whole slew of errors. There were so many that I the term window would scroll up that far. I did fix the errors, it turned out to be a couple of namespace errors and an extra semi-colon.

My question is how would I set the command to see all the errors. I tried to pipe it through more:
Code:
% g++ stdin_to_tree.cc | more
and I tried to redirect it to a file:
Code:
% g++ stdin_to_tree.cc > errlog
but those didn't work. So how could I either display the errors paginated on the screen or redirected to an error file?
 
Old 04-02-2008, 05:21 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
They are errors... try to redirect the standard error to a file
Code:
g++ stdin_to_tree.cc 2> errlog
or pipe after redirecting standard error to standard output
Code:
g++ stdin_to_tree.cc 2>&1 | more
 
Old 04-03-2008, 06:10 PM   #3
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Original Poster
Rep: Reputation: 30
Hello,

Quote:
Originally Posted by colucix View Post
They are errors... try to redirect the standard error to a file
Code:
g++ stdin_to_tree.cc 2> errlog
or pipe after redirecting standard error to standard output
Code:
g++ stdin_to_tree.cc 2>&1 | more
Thanks. For some reason, I thought the compiler errors were standard output instead of standard error.

I use the TCSH, so to redirect standard error is:
Code:
g++ stdin_to_tree.cc >& errlog
Thanks for the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd compiler errors dangerousdave Linux - Newbie 3 07-10-2005 02:47 PM
Compiler Errors utopia901 Linux - Newbie 7 04-28-2005 02:46 AM
C++ compiler errors vickyj Linux - Software 1 08-29-2004 02:54 AM
gcc compiler errors? johnnyrags Fedora 0 06-23-2004 05:53 PM
compiler errors barrynewt Linux - Software 6 08-29-2002 10:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration