Why do I get an assertion violation when I port my 32-bit FORTRAN MEX source to a 64-bit MATLAB 7.6 (R2008a) ?

4 次查看(过去 30 天)
I have an existing FORTRAN MEX source code which compiles and works fine on a 32-bit MATLAB. This source also compiles fine on 64-bit MATLAB, but it fails when I try to run it.

采纳的回答

MathWorks Support Team
Some legacy FORTRAN code use the following syntax to define the MEXFUNCTION:
SUBROUTINE MEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
INTEGER PLHS(*), PRHS(*)
INTEGER NLHS, NRHS
This might compile and execute on a 32-bit platform, however, the recommended syntax is to use MWPOINTER as shown below (for any platform).
This is essential for the MEX file to execute successfully on a 64-bit platform.
SUBROUTINE MEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
MWPOINTER PLHS(*), PRHS(*)
INTEGER NLHS, NRHS

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

产品


版本

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by