Linking mixed FORTRAN and C++ in the Visual studio 2008 environment -


I am calling a C ++ function by Fortran using the ISO_C_Binding module. I can compile and link Fortran and C ++ files using the command sequence. Pre>

To compile and add, I can use the gfortran option and with C ++ standard libraries

  gfrontran main.o print_hi.o -o main -lstdc ++   

Which work perfectly fine. Now my question is how can I do this in the visual studio environment. In the case of simple C, we can only include the print_hi.o file in additional dependencies in the linker, but if I include only this C ++ file (print_hi.o), then it gives errors such as

  error LNK2010: External symbol mentioned in function _print_en   

_ZSt4cout, so I think I need to give the path to the C ++ library in my Fortran project Because we can do the command line in the mingview case Area, but I do not know how to do it.

PS: I am using Windows Vista with Visual Component Professional Edition 11.1 in Visual Studio 2008 and Visual Studio 2008 in C ++ in the same computer.

This MSDN article can help you: and

Only note that this all VC ++ 6.0 concerns

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -