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

Christian Schulte cschulte at kth.se
Mon Aug 25 17:11:36 CEST 2008


First, the "fix" I just send does not fix the problem... It does for me but
not for Jan.

The crashes are totally bizarre, as far as the debugger tells the crash
occurs right in the heart of copying... That's close to impossible as Gecode
does not use char there...

I'll have a closer look tomorrow (my problem is that I know very little
about MSVC's IDE and hoped that I could get away with that). I'll try the
voodoo you suggest.

Maybe, you still use MSVC 2005?

Cheers
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/


-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Filip Konvicka
Sent: Monday, August 25, 2008 5:03 PM
To: users at gecode.org
Subject: Re: [gecode-users] How to use Gecode binaries from within MSVC's
IDE

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


_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list