Bug in dyn_mex.m
At present dyn_mex.m uses the undefined variables msvc and cygwin.
It also tries to export the wrong function from the _static.c file.
The fix is in the following commit in my branch: https://github.com/tholden/dynare/commit/0c533744750ed3247fd25c43b1fe82c1fea64bbb
It is also shown here:
Lines 50 to 65 of dyn_mex.m should read as follows:
if strcmp( win_compiler, 'msvc' )
% MATLAB/Windows + Microsoft Visual C++
eval(['mex -O LINKFLAGS="$LINKFLAGS /export:Dynamic" ' basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LINKFLAGS="$LINKFLAGS /export:Static" ' basename '_static.c ' basename '_static_mex.c'])
elseif strcmp( win_compiler, 'cygwin' )
% MATLAB/Windows + Cygwin g++
eval(['mex -O PRELINK_CMDS1="echo EXPORTS > mex.def & echo ' ...
'mexFunction >> mex.def & echo Dynamic >> mex.def" ' ...
basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O PRELINK_CMDS1="echo EXPORTS > mex.def & echo ' ...
'mexFunction >> mex.def & echo Static >> mex.def" ' ...
basename '_static.c ' basename '_static_mex.c'])
else
error(['When using the USE_DLL option, you must give either ' ...
'''cygwin'' or ''msvc'' option to the ''dynare'' command'])
end