I've been fighting with this problem on and off for days so, hopefully, someone here has an idea that might help me.
I've created a SWIG/Perl5 wrapper for a C++ library. I've built the extension for both ActiveState 5.8.9 and Strawberry Perl 5.16.3 (32-bit) in Debug and Release configurations. The module loads successfully in ActiveState under both configurations. In Strawbery 5.16, the debug configuration loads but the release configuration crashes while the SWIG-based DLL is loading. I've used printf statements to determine that the module is crashing in the first call to Perl_get_context() in the "boot_MyModule" function found in MyModule_wrap.cpp.
It sounds like, when a module runs in debug mode but crashes in release mode, the problem is usually related to some uninitialized variable being improperly used. But that doesn't look like the case here since the module is crashing before it even hits my code. I assume that I'm missing some kind if preprocessor flag specific to Straweberry Perl 5.16 but I haven't been able to figure out what might be missing. Has anyone here had a Perl5 module generated by SWIG crash in this way? Any ideas on what might cause this early call to Perl_get_context() to crash?
I'm using SWIG 2.0.11.