Im aware that this topic was discussed a lot in past, and many solutions were suggested and created. Anyway, no former solution I found in this forum helped me out, I'm clueless.
I work with VS2008, Intel C++ Compiler and Intel Visual Fortran.
At 1st a created an empty c++ project and added a .cpp file with the following source code:
using namespace std;
extern "C" __cdecl void RDNIST(double *);
double x = 4;
In the 2nd step a added a Fortran .dll project to the solution. Code as following:
REAL(8) :: FOO
FOO = FOO * 2
END SUBROUTINE RDNIST
In the c++ code I also tried __stdcall, __declspec(dllimport).
In the Fortran Code I tried also to add: !DEC$ATTRIBUTES REFERENCE, ALIAS: "_RDNIST":: RDNIST
Whatever I tried, I always got these two linker errors:
------ Build started: Project: CFoMix, Configuration: Debug Win32 ------
Compiling with Intel C++ 10.1.025 [IA-32]... (Intel C++ Environment)
Linking... (Intel C++ Environment)
xilink: executing 'link'
cfile.obj : error LNK2019: unresolved external symbol _RDNIST referenced in function _main
C:\Visual Studio 2008\Projects\CFoMix\CFoMix\Debug/CFoMix.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://C:\Visual Studio 2008\Projects\CFoMix\CFoMix\CFoMix\Debug\BuildLog.htm"
CFoMix - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
Unfortunatly, I haven't any clue why it does not want to work.
So if you have any ideas, I would be grateful.