Embedding a C++ function into a Fortran code turned out to be a real deal...
Inside my Fortran code I have to create some output files in JSON. To do that I found a C++ JSON parser that exploits some C++11 libraries. I work with VS2008 Professional integrated with IVF 11.1.070 and VC++ 2008 therefore I first tried to compile the parser with VC++ 2008 but it doesn't support C++11. So I installed VS 2015 community which includes VC++ 2015 and this allowed me to correctly compile the parser as a static library.
Since this is my first experience with mixed programming languages and I don't know exactly how to link all the necessary stuff, I started with a more rookie approach instead of directly linking the JSON parser library: I created a very simple C++ function "addition" and tried to call it from Fortran. That's the beginning of my problems...
Compiling this simple test as a static library with VC++ 2008 and mixing it with Fortran code was easy, I think that this is probably due to the same IDE. When I create the "addition" library in VS 2015 I can compile it with VC++ 2015 but when I add the file .lib to the Fortran source I got the error
"Error 1 error LNK2019: unresolved external symbol addition referenced in function MAIN_".
Does anyone have an idea how to solve this problem?