Re: [wxWidgets] shared/static release?

Christian Aichinger <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
On 08.05.2015 02:21, Chris Barker wrote:
> For what it's worth, some third party compilers can build extensions
> that are compatible with the MSVC-built python (mingw, for instance),
> and I'm pretty sure some folks are using TDM-GCC as well.

Hi!
The reason for using the same tools as Python is not directly the 
compiler, it's the C library (Microsoft Visual C Runtime Library, CRT). 
The CRT version used depends on the VS version and whether it's a 
release or debug build.[1]

The consensus[2] seems to be to strive to have all code linked into 
executable (the exe itself + all DLLs) use the same CRT version. Mixing 
versions may seem to work, but is often subtly broken if one CRT ever 
sees objects created by another CRT (e.g. stdin/stderr/stdout FILE* 
objects, malloc_CRT1() ->  realloc_CRT2(), all of C++).

As I understand it, MinGW uses the CRT from Visual Studio 6, so it 
doesn't resolve this problem. Cygwin uses it's own C runtime library 
(CYGWIN1.DLL), but that's also incompatible with VS compiled code.
I don't know about TDM-GCC.

In the end, it's possible to use any compiler desired, it's just a good 
idea to build _all_ code, including used DLLs, with that compiler to get 
sane library dependencies.[3]

Cheers,
Chris

[1]: True for all current VS versions, but versions >= VS2015 will
      use a common CRT for multiple VS versions, thankfully:
 
http://blogs.msdn.com/b/vcblog/archive/2014/06/10/the-great-crt-refactoring.aspx
[2]: http://siomsystems.com/mixing-visual-studio-versions
      http://www.virtualdub.org/blog/pivot/entry.php?id=296
      http://www.syndicateofideas.com/posts/fighting-the-msvcrt-dll-hell
[3] Check using depends.exe from http://www.dependencywalker.com

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.