On 6 Jul, 19:09, Thomas Jollans <tho...@jollans.com> wrote: > Okay, you need to be careful with FILE*s. But malloc and free? You'd > normally only alloc & free something within the same module, using the > same functions (ie not mixing PyMem_Malloc and malloc), would you not?
You have to be sure PyMem_Malloc is not an preprocessor alias for malloc (I haven't chaecked). In general, CRT objects cannot be shared across CRT boundaries. Also remember the C and C++ standard libraries interact. g++ from links statically with an incompatible C++ standard library (read: it will segfault, it's just a question of when). > Coming from a system where I can generally rely on the system gcc to > work for everything, I may be a bit naïve wrt certain questions ;-) On sane operating systems you generally have one version of libc installed. Windows did this too (msvcrt.dll) up to the VS2003 release, which came with msvcr71.dll in addition. Since then, M$ (pronounced Megadollar Corp.) have published msvcr80.dll, msvcr90.dll, and msvcr100.dll (and corresponding C++ versions) to annoy C and C++ developers into converting to C# .NET. (And yes, programs using third-party DLL and OCX components become unstable from this. You have to check each DLL/ OCX you use, and each DLL used by each DLL, etc. How fun...) -- http://mail.python.org/mailman/listinfo/python-list