How to redirect the output of gcc compiler to a file?

前端 未结 2 1381
暖寄归人
暖寄归人 2020-12-05 05:33

Redirection operator does not work. So how should we do it? One more question, in makefile, how can we give arguments from command line, like

run: a.out
             


        
2条回答
  •  被撕碎了的回忆
    2020-12-05 06:17

    Try: $ make 2>&1 | tee your_build_log.txt this will redirect stdout, 2>&1 redirects stderr to the same place as stdout while allowing you to simultaneously see the output in your terminal.

    see: How do I capture all of my compiler's output to a file?

提交回复
热议问题