1

我正在尝试一些不受支持的东西。我想使用 NAG Fortran 编译器(版本 5.3.1)来混合 Fortran 文件。

使用命令:

nagfor -ideclient -abi=64 -compatible -fpp -I"C:\Program Files\MATLAB\R2013b\extern\include" -Wl,-shared -thread_safe -L"C:\Program Files\MATLAB\R2013b\bin\win64" timesto.F -lmx -lmex -lmat -o timesto.mexw64

我能够编译和链接timestwo.FFortran 示例的改编版本。

我使用了下面非常简单的代码,效果很好。

#include "fintrf.h"
  subroutine mexFunction(nlhs, plhs, nrhs, prhs)
C     Declarations
  implicit none
C     mexFunction arguments:
  mwPointer plhs(*), prhs(*)
  integer nlhs, nrhs
  call mexEvalString('why')
  end

请注意,这mexEvalString是一个函数。

如果我现在改变

  call mexEvalString('why')

进入

  call mexErrMsgTxt('why')

编译仍然有效。然而,Matlab 在没有给出任何说明的情况下崩溃了。

我看到的两个语句之间的唯一区别是一个包含子例程而不是函数。

出了什么问题,我该如何解决?

4

0 回答 0