X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cpp;h=65a9f4d8d7da10e7537ea51fbb53d49ef3afb355;hb=24f4c51f0e399e114d36087a724692af661dcc6b;hp=9ffd8c27fd86e37e6a04afc573a87b7cbc00e96d;hpb=150cf11651ad92090a452bb9e6cb72d7eea886d5;p=lyx.git diff --git a/src/main.cpp b/src/main.cpp index 9ffd8c27fd..65a9f4d8d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Jean Marc Lasgouttes * * Full author contact details are available in file CREDITS. @@ -11,10 +11,9 @@ #include -#include "debug.h" #include "LyX.h" -#include "gettext.h" +#include "support/debug.h" #include "support/os.h" #include @@ -22,21 +21,34 @@ #include #endif +#ifdef WIN32 +#include +#endif + + +using namespace std; + + int main(int argc, char * argv[]) { #ifdef HAVE_IOS - std::ios_base::sync_with_stdio(false); + ios_base::sync_with_stdio(false); +#endif + +#ifdef WIN32 + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } + SetConsoleOutputCP(CP_UTF8); #endif // To avoid ordering of global object problems with some // stdlibs we do the initialization here, but still as // early as possible. - lyx::lyxerr.setStream(std::cerr); - - lyx::support::os::init(argc, argv); + lyx::lyxerr.setStream(cerr); - // initialize for internationalized version *EK* - lyx::locale_init(); + lyx::support::os::init(argc, &argv); lyx::LyX the_lyx_instance;