关于C#调用fortran的dll,奇怪的问题

luocong2000 2010-02-05 04:56:36
我用fortran生成dll
subroutine QPF6h(begin_t,f_m_in,f_r_in)
use IMSL
use global
use setup
use grid_num
!DEC$ attributes DLLEXPORT,ALIAS: 'callRef'::QPF6h
!DEC$ attributes value::begin_t
………………
End
在c#中调用如下
using System.Runtime.InteropServices;

namespace QPF
{
class Program
{
[DllImport("QPFdll.dll")]
public static extern void callRef(int t, string fname_m, int l1, string fname_r, int l2);
……
……
……
编译正确,并且在xp系统下运行通过,但是将程序放到2000系统下就出错,提示如下:
未处理的异常: System.DllNotFoundException: 无法加载 DLL“QPFdll.dll”: 找不到指
定的模块。 (异常来自 HRESULT:0x8007007E)。
在 QPF.Program.callRef(Int32 t, String fname_m, Int32 l1, String fname_r, Int32
l2)
在 QPF.Program.Main(String[] args)

另外,我用的fortran编译器是cvf6.5,c#编译器是vs2008,请教各位怎么解决(程序要放在2000的服务器上运行)?
...全文
239 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
luocong2000 2010-02-05
  • 打赏
  • 举报
回复
问题解决
利用C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\Depends.Exe检测,引用的dll需要的支持文件,比如dll等。
本帖中2000缺少DFORRT.DLL,从xp下拷贝过去好像就没有这种问题了。

参阅了帖子:
http://www.cnblogs.com/kiddo/archive/2008/04/11/1148427.html
谢谢!
luocong2000 2010-02-05
  • 打赏
  • 举报
回复
自己不断地顶上去,希望能有人帮忙!
很急,希望版主别当成水贴删掉!
老Key 2010-02-05
  • 打赏
  • 举报
回复
是很奇怪。。顶

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧