[gecode-users] How to use Gecode binaries from within MSVC's IDE

Filip Konvička filip.konvicka at logis.cz
Mon Aug 25 17:03:05 CEST 2008


Hi Christian,

> The IDE defines the macros UNICODE and _UNICODE: when compiling with these
> macros set, things crash.

strange - I'm using UNICODE all the time without problems.

IMHO it does only one thing: all Windows headers switch to the Unicode 
APIs (and TCHAR is defined as wchar_t etc.) You can also use 
wmain(int,wchar_t*[]) instead of main(int,char*[]) for programs.

What you might be interested in is putting this at the very start of 
your 'main' (I even do this before main in some static initializers...):

#ifdef WIN32
     setlocale(LC_ALL, ".OCP");
#else
     setlocale(LC_ALL, "");
#endif

(for console applications). This makes the iostream libraries use the 
correct locale for translating console IO to/from wchar_t properly.

I'm still wondering what crashes are you experiencing??

Cheers,
Filip





More information about the gecode-users mailing list