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

Filip Konvička filip.konvicka at logis.cz
Wed Sep 3 16:50:35 CEST 2008


> 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