Last fall I discovered a problem with Watcom C++10.5 mex files (Matlab
4.2c; Windows NT3.51; pentium) as follows. When the C++ program
executes delete[] on an array of type T, and T has a nontrivial
destructor, a GPF results that crashes Matlab. At the time, I traced
the problem to the fact that a jump table in the Watcom C++ run-time
system was not properly initialized when the mex file is loaded. I
found a very complicated workaround, namely, disassemble the module
'stabarr' in library plib3s, give the routine "void near init()" a
second name that was public, reassemble, update plib3s, and then
invoke "void near init()" (using its new public name) at the beginning
of the mex file.
This problem is still present with Watcom C++10.6, and Mathworks'
technical note 1606 doesn't seem to help. I am wondering if anyone
has encountered the same problem, and has found a better workaround.
Thanks,
Steve Vavasis