I am having difficulty with the 'Visual Fortran Calling Visual C Example'. The example is working fine as is, but following the instructions in the source file I have created a C++ DLL and get the following Fortran linking error
N: empFortran testVF Calls VCfmain.f90
fmain.obj : error LNK2001: unresolved external symbol _C_ROUTINE@20
Debug/VF Calls VC.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I have Aliased the DLL function ?c_routine@@YAXHPAD0@Z and confirmed the Exported name matches that in the DLL. I have also tried exposing _C_ROUTINE@20 in the C++ DLL, but the same error is raised.
I would also like to convert the Fortran into a DLL. Is it possible for a Fortran DLL to make calls to a C++ DLL? or the Fortran DLL to have C++ routines?