could anyone help with this problem?
I have an old file with the following function call:
void _fortran cstress(LONG *, LONG *);
I read the expression _fortran is obsolete.
How can I replace it??
Thanks in advance for your kind response.
[cpp]#includeand fsub.f90, with:
void cstress_(long&, long&);
using namespace std;
cout << "y = " << y << endl;
[fortran]subroutine cstress(x,y)I compile them using
integer :: x,y
end subroutine cstress
[bash]$ ifort -c fsub.f90and run the resulting program
$ icpc cxmain.cpp fsub.o
[bash]$ ./a.outNote that in Linux icpc/ifort an underscore is appended in C++ to the Fortran subroutine name, and that the default calling convention in Intel Fortran is to call by reference. On Windows, you may use cstress (no underscore) in the C++ main, and compile the Fortran subroutine with the /Qlowercase option.
y = 16