S
Sascha T.
Hi!
I have desperately searched google and its groups in vain. Hope you can
help with my problem. I need to call some ancient Fortran objects by
C++-main program with the latest Intel Compiler V8.1 on Linux 2.6.x.
Compilers are properly installed and working, means, LD_LIBRARY_PATH and
PATH is set correctly.
Calling Fortan (example.f) from C (main.c) works fine using
However, C++ seems to have some problems. Here are the codes:
----- FORTRAN: function.f -----
SUBROUTINE fortrantest()
IMPLICIT NONE
PRINT *, "Simple test o.k."
END
----- C++: main.C ----------
#include<iostream>
using namespace std;
extern "C"
{
extern void fortrantest_();
}
int main()
{
cout << "Testing call" << endl;
fortrantest_();
}
----------------------
using
works without errors, but linking with
produces lots of undefined refs. icpc produces different
and fewer error-messages
: undefined reference to `for_write_seq_lis'
Any suggestions welcome!
Thanx
ST
I have desperately searched google and its groups in vain. Hope you can
help with my problem. I need to call some ancient Fortran objects by
C++-main program with the latest Intel Compiler V8.1 on Linux 2.6.x.
Compilers are properly installed and working, means, LD_LIBRARY_PATH and
PATH is set correctly.
Calling Fortan (example.f) from C (main.c) works fine using
icc -c main
ifort -o main main.o function.f -nofor_main
However, C++ seems to have some problems. Here are the codes:
----- FORTRAN: function.f -----
SUBROUTINE fortrantest()
IMPLICIT NONE
PRINT *, "Simple test o.k."
END
----- C++: main.C ----------
#include<iostream>
using namespace std;
extern "C"
{
extern void fortrantest_();
}
int main()
{
cout << "Testing call" << endl;
fortrantest_();
}
----------------------
using
icpc -c main.C
ifort -c function.f -nofor_main
works without errors, but linking with
ifort -o main function.o main.o -nofor_main main.o
produces lots of undefined refs. icpc produces different
and fewer error-messages
function.o(.text+0x36): In function `fortrantest_':icpc -o main function.o main.o
: undefined reference to `for_write_seq_lis'
Any suggestions welcome!
Thanx
ST