Hi there,
I’m trying to couple Intel FORTRAN and VC++ and after lots of search on books and the other stuff still receiving errors.
The main Problem is passing arrays to Fortran When in FORTRAN I change the arrays value (e.g FA(5)=8) I don't receive any error message bur when I use loop to change array values (e.g., FA(i)=5, I receive following error message.
In programming I'm using MS VS.NET 2003.
Please help me
Thanks
ERRORs:
NTR2CALL error LNK2019: unresolved external symbol _ALI@12 referenced in function _main
NTR2CALL fatal error LNK1120: 1 unresolved externals
=============== =============== =============== ========FORTRAN
SUBROUTINE ALI(g,b,FA)
Real*8 a,b
integer i
Real*8 FA(10)
b=110+a
DO i = 1, 6
FA(i)=1
enddo
END SUBROUTINE ALI
=============== =============== =============== ========VC++
// external Fortran function prototype
#include "stdafx.h"
using namespace std;
#include "iostream"
#include "Fortran.h"
extern "C" {void __stdcall ALI(double&,dou ble&,double*);}
#pragma comment(lib, "Lib1.lib")
void main()
{
double a,b;
int i=0;
double FA[10]={1,2,3,4,5,6,7 ,8,9,10};
cout<<endl
<<"Enter a"
<<endl
<<endl;
cin>>a;
ALI(a,b,FA);
cout<<endl
<<"b=a+110= "
<<b
<<endl
<<endl
<<endl;
for (i=0;i<10;i++)
{
cout<<" "<<FA[i];
}
cout<<endl
<<endl
<<endl;
return;
}
I’m trying to couple Intel FORTRAN and VC++ and after lots of search on books and the other stuff still receiving errors.
The main Problem is passing arrays to Fortran When in FORTRAN I change the arrays value (e.g FA(5)=8) I don't receive any error message bur when I use loop to change array values (e.g., FA(i)=5, I receive following error message.
In programming I'm using MS VS.NET 2003.
Please help me
Thanks
ERRORs:
NTR2CALL error LNK2019: unresolved external symbol _ALI@12 referenced in function _main
NTR2CALL fatal error LNK1120: 1 unresolved externals
=============== =============== =============== ========FORTRAN
SUBROUTINE ALI(g,b,FA)
Real*8 a,b
integer i
Real*8 FA(10)
b=110+a
DO i = 1, 6
FA(i)=1
enddo
END SUBROUTINE ALI
=============== =============== =============== ========VC++
// external Fortran function prototype
#include "stdafx.h"
using namespace std;
#include "iostream"
#include "Fortran.h"
extern "C" {void __stdcall ALI(double&,dou ble&,double*);}
#pragma comment(lib, "Lib1.lib")
void main()
{
double a,b;
int i=0;
double FA[10]={1,2,3,4,5,6,7 ,8,9,10};
cout<<endl
<<"Enter a"
<<endl
<<endl;
cin>>a;
ALI(a,b,FA);
cout<<endl
<<"b=a+110= "
<<b
<<endl
<<endl
<<endl;
for (i=0;i<10;i++)
{
cout<<" "<<FA[i];
}
cout<<endl
<<endl
<<endl;
return;
}
Comment