I am going to call a C++ function from FORTRAN, for which I am using ISO_C_Binding module. After compaction of the FORTRAN main file and C++ function with commands
gfortran -c mlp8.f90
g++ -c mean_cpp.cc
Which will create the objects files but in the linking phase as suggested by some members I am going to use the commands
g++ mlp8.o mean_cpp.o -o main –lgfortran
I.e. using C++ compiler with linking to FORTRAN libraries but it gives error like
/Cygnus/cygwin-b20/H-i586-cygwin32/i586-win32/bin/ld:
cannot open –lgfortran: No such a file or directory
Collect2:ld return 1 exit status
So I think the main problem is that the g++
linker can not link with the FORTRAN libraries, so may be I need to include some path in the linking option or may be I need to do some setting in the g++
complier, which I don’t know how to do this, so please help to sort out this problem.