声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2097|回复: 1

[混合编程] Matlab编译Fortran程序的问题

[复制链接]
发表于 2009-2-25 17:09 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
之前看到过别人问类似的问题,但没有找到有效的解决方法。

>> 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 9.1 (with Microsoft Visual C++ 2005 linker) in C:\Program Files\Intel\Compiler\Fortran\9.1
[2] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2008a\sys\lcc\bin
[3] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft Visual Studio 8
[4] Microsoft Visual C++ .NET 2003 in C:\Program Files\Microsoft Visual Studio .NET 2003
[5] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio

[0] None

Compiler: 1

Please verify your choices:

Compiler: Intel Visual Fortran 9.1
Location: C:\Program Files\Intel\Compiler\Fortran\9.1

Are these correct [y]/n? y

Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2008a\mexopts.bat
From template:              C:\PROGRA~1\MATLAB\R2008a\bin\win32\mexopts\intelf91msvs2005opts.bat

Done . . .

>> mex matdemo1.f
LINK : error LNK2001: unresolved external symbol MEXFUNCTION
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\mex_mWJdrC\templib.lib : fatal error LNK1120: 1 unresolved externals

  C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Link of 'matdemo1.mexw32' failed.

??? Error using ==> mex at 207
Unable to complete successfully.

这里用的Fortran源文件是Matlab R2008a自带的示例文件matdemo1.F。最后生成了一个空的matdemo1.mexw32文件。
请指教。
谢谢!
回复
分享到:

使用道具 举报

发表于 2009-2-25 21:34 | 显示全部楼层
几十年前曾玩过! 後来懒得用fortran了! 而且新版都没试过了!
sorry! 等用过的专家, 路过吧!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-12 14:58 , Processed in 0.057875 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表