[gecode-users] Linking to Gecode with Microsoft Visual C++

Christian Schulte cschulte at kth.se
Wed Sep 3 19:14:23 CEST 2008


There is some good news, though. For 3.0 everything works fine and we will ship in our binary packages both sets of libraries (actually, the release libraries will not have any PDB information, while the debug libraries will be the full debug libraries). Linking will be simpler as the right library will be picked up automatically.

Christian

-----Original Message-----
From: Filip Konvička [mailto:filip.konvicka at logis.cz] 
Sent: Wednesday, September 03, 2008 4:51 PM
To: Christian Schulte
Cc: users at gecode.org
Subject: Re: [gecode-users] Linking to Gecode with Microsoft Visual C++


> Oh, two more things: it is not an issue with different versions of MSVC, we
> used the same version. And most importantly, after some thinking it is quite
> clear why it should not work: you link std::ostream twice, once inside the
> Gecode DLLs against the optimized MSVC libs, and the second time in your
> program against the debug MSVC libs. That is, in fact asking quite much.

Ah, I see. We probably never tried to output the variables to a
std::ostream, instead we took the actual values from the solution and
worked with them. So we probably never used anything in the interface
that was not related to Gecode, such as things from namespace std.

Also, since all memory allocation in Gecode is done consistently (i.e.
by Gecode), we never run into the problem of mixing MD and MDd heap mgmt
function calls. (This is probably much more serious thing than the
std::ostream issue!)

So another suggestion to everyone is that as long as they stick to the
"pure Gecode" API, they should be "safe" even with pre-3.0 Gecode. But,
as you say, it's best if you provide both "debug" and "release" versions.

Thanks for the explanation!

Cheers,
Filip






More information about the gecode-users mailing list