Visual Studio ‘Output’ panel doesn’t use the stderr pipe as a source. If you dig into the DBG macro you will find it writes to OutputDebugString, which is a special Windows method for communicating with the debugger if present.
DBG on both platforms will do what you want. You shouldn’t be using stderr for anything other than error messages.
Both std::cout and std::cerr is fine to use, You would see cout/cerr output if you executed your code from the command line/terminal, It’s only when you’re running your program inside a debugger that things are a little different.
Typically you would use the DBG macro for text you wouldn’t normally want anyone to see in normal operation, Infact the macro does nothing when you build your program in release mode.
cout/cerr is used for text you do want printed, Normal messages and Error messages respectfully.