linux g++ compiler redirect stderr and stdout creates empty file linux g++ compiler redirect stderr and stdout creates empty file shell shell

linux g++ compiler redirect stderr and stdout creates empty file


One of your comments betrays that you are not using bash. You're using csh or tcsh. In that case, you can redirect all output (including standard error) like this:

g++ -c Algorithms.cpp >& output

For more csh redirection syntax, I have a useful link bookmarked. Note that csh redirection syntax is not as fluent as bash syntax. You can do more in bash than you can in csh.


You might try this:

sh/bash/zsh version:

g++ -c -I ~/cplusplus/boost_1_37_0/boost_1_37_0/ \       -I ~/cplusplus/niVxWorksDeliver/TEES/ \       Algorithms.cpp > output 2>&1

csh or tcsh version:

g++ -c -I ~/cplusplus/boost_1_37_0/boost_1_37_0/ \       -I ~/cplusplus/niVxWorksDeliver/TEES/ \       Algorithms.cpp >& output


"No news is good news" -- does your command even produce any output? When there are no errors, g++ won't print out anything!