Hello,
I'm porting a C++ Windows console application that can be simplified as:
#include <Windows.h> #include <iostream>
int main(int, char**) { std::cout << "standalone output";
OutputDebugStringW( L"debug output" );
return 0; }
When launched outside of Visual Studio, this app opens a window with a console inside, displays "standalone output" and shuts down. When launched from Visual Studio, it does the same but also displays "debug output" in the debug output pane of Visual Studio.
I'd like to obtain the same behavior with Xcode.
- When launched from the terminal, the app should only display "console output". - When launched from Xcode, the Xcode console should only display "debug output", and the app console should only display "standalone output".
- cout output is displayed in the Xcode console. Is there a way to avoid this? - On this Stack Overflow page, it is recommended that the debug output be activated only if the debugger is detected. Is this the preferred equivalent to OutputDebugString for a C++ app?
Thanks. |