Closed jaeandersson closed 8 years ago
The problem appears to be that the matlab bindings emits a typemap for char []
when they shouldn't. If you look at the same code for Python, you get:
SWIGINTERN int Swig_var_BeginString_FIX44d_set(PyObject *_val) {
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""read-only BeginString_FIX44d""' of type '""char []""'");
return 0;
fail:
return 1;
}
i.e. no matching typemap. But for some reason, the MATLAB bindings do find a matching typemap, but one which doesn't compile.
@wsfulton - any ideas?
You can analyse which typemaps are being applied by using the -debug-tmused
and/or debug-tmsearch
options. Compare the two target languages. I get:
./../arrays_global.i:45: Searching for a suitable 'varin' typemap for: char BeginString_FIX44d[]
Looking for: char BeginString_FIX44d[]
Looking for: char []
Using: %typemap(varin) char []
Finding the typemap can then be a challenge, but if you run with the -E
option and analyse the output, it is quite easy to find that it comes from strings.swg. I presume MATLAB is using the UTL, so this typemap should 'come for free'. Is MATLAB not using the UTL typemaps?
@wsfulton OK, thanks! I've managed to isolate the problem. The problem is that the varin
and varout
typemaps are never emitted.