Ok, that makes sense. So, in my case, what do you think I have to
change in order to follow the rules?
I mean, I'm using a DLL release of libssh, and storing my wrapper into
another DLL (which uses a lot of other libraries like pcre, boost,
etc...). If the callback function of libssh2 asks to allocate memory for
that variable in MY dll, and then deallocates that memory in libssh2's
DLL. What options do I have? (apart of defining my own memory allocator).
Ezequiel
El 07/09/2010 11:05 a.m., Alexander Lamaison escribió:
El 07/09/2010 01:09 a.m., Mikhail Gusarov escribió:
Twas brillig at 21:37:44 06.09.2010 UTC+01 when [email protected] did gyre
and gimble:
AL> This isn't an MSVC problem or even a Windows problem though it is
AL> often reported that way. It will happen with _any_ compiler on _any_
AL> OS if two shared libraries are linked against different versions of
AL> the C runtime and objects owned by one runtime are shared with the
AL> other.
If and only if C runtime implementation is stupid and does not handle
this situation.
MSVC one is.
On 7 September 2010 14:47, Ezequiel Ruiz<[email protected]> wrote:
Indeed. I've tested the code with Mingw (GCC 4.4) and it works OK.
This will be because Mingw doesn't give you the option of linking to
different runtime versions (such as Debug variants), not because MSVC
is 'broken' and Mingw is not. Your code will still be violating the
rules and works by luck.
Alex
--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel