I getting a link error when trying to call Fortran function from C++.
Firstly, I am using MSVS and Intel Fortran (relevant for symbol underscores and case sensitivity).
I have a Fortran main in project A. The functions in A call a C++ project B. So far so good. The functions in B calls a C++ function "void message(const char* msg, const int msg_max_len);" in project D. All is good.
I want to call a Fortran subroutine MESSAGE in project E instead of the C++ message in project D. In the C++ project B I defined a configuration with the preprocessor macro "_C2F" and added the following to the client code in B:
#ifdef _C2F
extern "C" void _MESSAGE(const char* msg, const int msg_max_len);
#define message _MESSAGE
#endif
after the include header for containing the prototype for message.
I get the link error:
2>lib_physical_properties.lib(pp_asme.obj) : error LNK2019: unresolved external symbol __MESSAGE referenced in function _pp_asme
What do I need to do to correct linkage?