I'm running into some really weird problems with ctypes.  I'm using ctypes to interface to a C++ library that has a C interface.  The library has lots of parallel functionality.  More often than not, the parallel calls tend to end up with a segfault from the C++ layer, but I've run into them with some serial code too.  I'm wondering if there is any restriction on whether the Python interpreter and the C++ code need to be compiled with the same version of the C++ compiler?  If so, how do I find out what c++ was used to build Python?  I've tried to run strings on Python and grep for gcc and g++, nothing shows up.
There's no requirement at all that the native library that you call with ctypes has to be built with a matching runtime. In fact there's not even a requirement that the native library even uses a C runtime.
For example you can use ctypes to call code written in other languages, e.g. Delphi. Or you can use ctypes to call Windows API functions which are not linked against MSVC.
I guess you'll have to look elsewhere to resolve your problem!
ctypes - does python need to be compiled with same version as C library?