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
If you don't need to use either yourself, the easiest thing to do would be to just redirect standard output and standard error from the command line when you start your program.
$ myprog >/dev/null 2>&1
If you do want to use them yourself, the trick would be to change the streambuf they use. There's some code and discussion about how to do that here. Its really too long to post here.