I m including a fortran90 program that is not mine in my C++ project .
In the first stept I try to call the function by their name_() and i get the error \"undefin
I am assuming you are using the g++, gfortran, mpif90 toolchain. If you have a module
module rocker
contains
subroutine bye_baby
...
end subroutine
The external C declaration for it in C++ is
extern "C"
{
// ,-- 2 Leading underscores to start
// | ,-- then the module name
// | | ,-- then _MOD_
// | | | ,-- then the subroutine name
// V V V V
extern void __rocker_MOD_bye_baby();
}
You may also need to add attribute((stdcall)) after the extern. By default, C assumes cdecl which stacks the parameters differently.
If you do not want the __rocker_MOD part, then the subroutine/function should not be declared in a module.