fortran 错误:错误 1 error LNK2019: 无法解析的外部符号 _ENGOPEN,该符号在函数 _MAIN__ 中被引用 10
C#include"fintrf.h"C#if0CCfengdemo.FC.Ffileneedtobepreprocessedtogenerate.forequivale...
C#include "fintrf.h"
C#if 0
C
C fengdemo.F
C .F file need to be preprocessed to generate .for equivalent
C#endif
C
C fengdemo.f
C
C This is a simple program that illustrates how to call the MATLAB
C Engine functions from a FORTRAN program.
C
C Copyright 1984-2005 The MathWorks, Inc.
C======================================================================
C $Revision: 1.9.4.4 $
program main
C-----------------------------------------------------------------------
C (pointer) Replace integer by integer*8 on 64-bit platforms
C
c mwpointer engOpen, engGetVariable, mxCreateDoubleMatrix
c mwpointer mxGetPr
c mwpointer ep, T, D
C----------------------------------------------------------------------
C
C Other variable declarations here
double precision time(10), dist(10)
integer engPutVariable, engEvalString, engClose
integer temp, status
data time / 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 /
C
ep = engOpen('matlab ')
C
end
没人懂吗?? 展开
C#if 0
C
C fengdemo.F
C .F file need to be preprocessed to generate .for equivalent
C#endif
C
C fengdemo.f
C
C This is a simple program that illustrates how to call the MATLAB
C Engine functions from a FORTRAN program.
C
C Copyright 1984-2005 The MathWorks, Inc.
C======================================================================
C $Revision: 1.9.4.4 $
program main
C-----------------------------------------------------------------------
C (pointer) Replace integer by integer*8 on 64-bit platforms
C
c mwpointer engOpen, engGetVariable, mxCreateDoubleMatrix
c mwpointer mxGetPr
c mwpointer ep, T, D
C----------------------------------------------------------------------
C
C Other variable declarations here
double precision time(10), dist(10)
integer engPutVariable, engEvalString, engClose
integer temp, status
data time / 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 /
C
ep = engOpen('matlab ')
C
end
没人懂吗?? 展开
3个回答
展开全部
你好,我也遇到过这个问题,刚刚解决了。出错的原因在于你写subroutine的时候,有一些引用的参数,而你在CALL 这个SUBROUTINE时,参数与子程序写的参数不统一,如:
CALL CONSTRUCT_X(Mloc,Mloc1,Nloc,DX,U,DelxU,UxL,UxR,Kappa)
。。。。。。
SUBROUTINE CONSTRUCT_X(M,M1,N,DX,Vin,Din,OutL,OutR,Kappa,D2X)
我的是这样的,subroutine里加了一个变量D2X,而call 时没有对应修改,所以出错,直接把call语句修改一下就ok了,改成:
CALL CONSTRUCT_X(Mloc,Mloc1,Nloc,DX,U,DelxU,UxL,UxR,Kappa,D2X)
CALL CONSTRUCT_X(Mloc,Mloc1,Nloc,DX,U,DelxU,UxL,UxR,Kappa)
。。。。。。
SUBROUTINE CONSTRUCT_X(M,M1,N,DX,Vin,Din,OutL,OutR,Kappa,D2X)
我的是这样的,subroutine里加了一个变量D2X,而call 时没有对应修改,所以出错,直接把call语句修改一下就ok了,改成:
CALL CONSTRUCT_X(Mloc,Mloc1,Nloc,DX,U,DelxU,UxL,UxR,Kappa,D2X)
展开全部
你子程序的名字和主程序中调用的子程序名称不一样。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询