diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 870120e..e81c846 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,9 +16,21 @@ #include "session.h" #include <QTranslator> #include <QLibraryInfo> +#ifdef _WIN32 +#include <windows.h> +#include <cstdio> +#endif int main(int argc, char **argv) { + // a beautiful hack to be able to write to stdout on Windows +#ifdef _WIN32 + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } +#endif + // create and load configuration std::unique_ptr<Configuration> config = std::make_unique<Configuration>(nullptr); #ifdef QT_DEBUG |