Suppress output to cout from linked library

后端 未结 6 1129
感情败类
感情败类 2020-12-31 19:49

I need to link my C++ programs against a couple shared libraries which generate way too much output to std::cout and std::cerr rendering them both

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 20:34

    If they are really outputting through std::cout and std::cerr then you could replace those object's stream buffers, but you would have to redirect your own program's output through other streams. See this question for how to do this.

    However, if they use std::printf() etc. then this won't work.

提交回复
热议问题