On Aug 10, 8:34 pm, Pawel_Iks <pawel.labed...@gmail.comwrote:
Suppose I have lib.o file with fortran functions (I know their names
and the lists of them arguments). How to write c++ program, which use
one of these functions, for example I want to use fortran function
which return int value and have as arguments two double numbers, and
how to compile it be g++ for example?
Of course, you have to link that library. But there are some
differences(as far as I know) between F77 and F90 concerning the IO.
I, myself, use F77 on linux. I can link Lapack and C++ for instance
with g++.
You can also check the functions in the object file by the nm command.
See man nm
Also the function names most of the time take _ character, ex: for the
F77 functin foo, you have to call it as foo_ in C++ and make proper
extern declerations. These are the things I can quickly tell. But
Take a look at these pages and the similar ones
http://www.math.utah.edu/software/c-with-fortran.html
Mixed language programming and C++and Fortran or things like that.
HTH,
Umut