How to use mex for C functions on MATLAB 7.10?
Show older comments
Hi. I have some of my own code developed for MATLAB R2007 which calls my own C function, which has been running fine for years. On MATLAB 7.10, running on Windows 7 (64-bit PC), I recompiled the C function with mex and got a .mex64 file. However MATLAB crashes when it reaches that point in the code. Using mex -setup I only get the Microsoft Visual 2008 compiler as an option and none of the built-in compilers that older MATLAB versions had. Is there some special setup of Visual Studio 2008 I should use? Or some other trick with mex? Can anyone help me please? Thanks.
Answers (1)
Friedrich
on 14 Aug 2011
0 votes
Hi,
you moved from 32bit to 64bit. Beware that the size of some datatypes changes. The best way here is to debug your mex file:
This will help you to figure out in which line your mex file crashes.
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!