当前位置:编程学习 > C/C++ >>

intel Fortran 调用VC创建的Lib

Vc建立lib项目
//Mydll.cpp
#include <stdio.h>

#define Maxx MAXX
#define Minn MINN
extern "C"
{
int Maxx(int a, int b)
{
    if(a >= b)return a;
    else
    return b;
}
int Minn(int a, int b)
{
if(a >= b)return b;
else
return a;
}
}

intel Fortran 调用:
      program main    !(可要或者不要)

      inte易做图ce
        integer function maxx(a,b)
        integer a,b
        !ms$attributes c,alias:'_MAXX':: maxx
        end function maxx
        integer function minn(a,b)
        integer a,b
        !ms$attributes c,alias:'_MINN':: minn
        end function minn
      end inte易做图ce


      integer aa,bb,cx,cd
      aa=12
      bb=21
      cd=maxx(aa,bb)
      cx=minn(aa,bb)
      write(*,*)cx,cd
      end program

补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,