BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / matlab / #7705同步于 2010/11/9
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Matlab机器人发帖

matlab+fortran混合编程

scorpion
2010/11/9镜像同步0 回复
本人最近在做matlab和fortran的混合编程,但mex -***.F总是不能成功,会有“LINK : error LNK2001: 无法解析的外部符号 MEXFUNCTION”的提示,不知有没有达人做过这方面的工作,跪求指导!在线等回复! 以下是matlab中的命令提示: >> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [1] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker) in C:\Program Files\Intel\Compiler\Fortran\10.1.014\ [2] Lcc-win32 C 2.4.1 in E:\PROGRA~1\MATLAB\R2010a\sys\lcc [3] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8 [4] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio [5] Open WATCOM C++ in e:\watcom-1.3 [0] None Compiler: 1 Please verify your choices: Compiler: Intel Visual Fortran 10.1 Location: C:\Program Files\Intel\Compiler\Fortran\10.1.014\ Are these correct [y]/n? y *************************************************************************** Warning: Support for Intel Visual Fortran 10.1 will be discontinued in a future release, at which time new versions will be supported. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/ *************************************************************************** Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010a\mexopts.bat From template: E:\PROGRA~1\MATLAB\R2010a\bin\win32\mexopts\intelf10msvs2005opts.bat Done . . . ************************************************************************** Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************** >> mex -v yprimef.F This is mex, Copyright 1984-2007 The MathWorks, Inc. -> Default options filename found in C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010a ---------------------------------------------------------------- -> Options file = C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010a\mexopts.bat MATLAB = E:\PROGRA~1\MATLAB\R2010A -> COMPILER = ifort -> Compiler flags: COMPFLAGS = /fpp /Qprec "/IE:\PROGRA~1\MATLAB\R2010A/extern/include" -c -nologo -DMATLAB_MEX_FILE /fixed /MD /fp:source /assume:bscc OPTIMFLAGS = -Ox -DNDEBUG DEBUGFLAGS = /Z7 arguments = Name switch = /Fo -> Pre-linking commands = -> LINKER = link -> Link directives: LINKFLAGS = /DLL /EXPORT:MEXFUNCTION /LIBPATH:"E:\PROGRA~1\MATLAB\R2010A\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:"C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\templib.x" /MAP:"yprimef.mexw32.map" /NOLOGO /INCREMENTAL:NO LINKDEBUGFLAGS = /debug /PDB:"yprimef.mexw32.pdb" LINKFLAGSPOST = Name directive = /out:"yprimef.mexw32" File link directive = Lib. link directive = Rsp file indicator = @ -> Resource Compiler = rc /fo "mexversion.res" -> Resource Linker = ---------------------------------------------------------------- --> ifort /fpp /Qprec "/IE:\PROGRA~1\MATLAB\R2010A/extern/include" -c -nologo -DMATLAB_MEX_FILE /fixed /MD /fp:source /assume:bscc /FoC:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\yprimef.obj -Ox -DNDEBUG -DMX_COMPAT_32 yprimef.F Contents of C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\mex_tmp.rsp: C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\yprimef.obj --> link /out:"yprimef.mexw32" /DLL /EXPORT:MEXFUNCTION /LIBPATH:"E:\PROGRA~1\MATLAB\R2010A\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:"C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\templib.x" /MAP:"yprimef.mexw32.map" /NOLOGO /INCREMENTAL:NO @C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\MEX_TMP.RSP LINK : error LNK2001: 无法解析的外部符号 MEXFUNCTION C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_EH~1\templib.x : fatal error LNK1120: 1 个无法解析的外部命令 E:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Link of 'yprimef.mexw32' failed. ??? Error using ==> mex at 222 Unable to complete successfully.
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。