How to view g++ long error message

L

Lambda

I am using g++ to compile a program.
g++ outputs so many warnings and errors that
I cannot see the first error message that I think I should fix first

I try to use 'g++ exer.cc | less' but it doesn't work.

I try to 'g++ exer.cc > er' but it doesn' work either.

What can I do with it?
 
V

Victor Bazarov

Lambda said:
I am using g++ to compile a program.
g++ outputs so many warnings and errors that
I cannot see the first error message that I think I should fix first

I try to use 'g++ exer.cc | less' but it doesn't work.

I try to 'g++ exer.cc > er' but it doesn' work either.

What can I do with it?

or any manual for your shell to see what syntax
you need for redirecting the standard ERROR output (like "2> er"
or something).

V
 
J

Johannes Bauer

Lambda said:
I try to use 'g++ exer.cc | less' but it doesn't work.

I try to 'g++ exer.cc > er' but it doesn' work either.

When using bash, try

g++ exer.cc 2>&1 | less

or

g++ exec.cc >er 2>&1

when you want the errors to end up in file "er".

Greetings,
Johannes
 
T

Thelma Roslyn Lubkin

: I am using g++ to compile a program.
: g++ outputs so many warnings and errors that
: I cannot see the first error message that I think I should fix first

: I try to use 'g++ exer.cc | less' but it doesn't work.

Try 'g++ exer.cc | & less' OR
'g++ exer.cc | cat > & er'

--thelma
 
L

Lambda

or any manual for your shell to see what syntax
you need for redirecting the standard ERROR output (like "2> er"
or something).

V

I used
g++ exer.cc 2> er
and the message went to the file 'er'
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,196
Messages
2,571,036
Members
47,631
Latest member
kukuh

Latest Threads

Top