Matlab DLL problem with MSVC 8/2005



Hello,

I am using Matlab (mcc -b csharedlib:foolib foo.m) to create the foolib.dll, using the example from MATLAB Central. I am linking that to MSVC 8/2005 by setting all the directories and iclude paths.

Compilation works great. All the Matlab-style commands like "mxArray" and "mclInitializeApplication" run successfully. The program runs fine with the "mx" and "mcl" items, but crashes as soon as I try to step through any function from within the foolib.lib/dll.

The failure is "Unhandled exception xx in test.exe: xx: Access violation reading location xxx."

The failed line is in gs_support.c, line 174 in this version:

#if defined (_WIN64)
cookie = systime.ft_scalar;
#else /* defined (_WIN64) */
cookie = systime.ft_struct.dwLowDateTime; <----
cookie ^= systime.ft_struct.dwHighDateTime;
#endif /* defined (_WIN64) */

I have compiled test.exe with /GS- in order to avoid security, but nothing changes.

I have tried the solutions in the thread below with no resolution.
http://www.mathworks.de/matlabcentral/newsreader/view_thread/71208

Please advise!

andre
.


Loading