PDA

View Full Version : Linking libraries or dlls


GTDoc98
11-26-2003, 03:02 PM
I have a library that was written by an outside source in Microsoft Visual C++ and a copy of the same code compiled into a dll. I would like to be able to call surboutines from these libraries (or from the dll) in my FORTRAN program(s). I have tried a number of options and I was thinking that is should be rather easy but I can't seem to close the gap and get this done. Any help would be greatly appreciated.
Thanks.

tzeis
12-02-2003, 05:40 PM
There are basically three thing that you need to do to call a dll: import the procedures from the dll by declaring them in a dll_import statement, compile the code with the "-ml msvc" option, and add the import library for the dll to the link command. We provide examples of linking to Microsoft Visual C code statically and in dlls in the LF9557\Examples\Mix_lang\MSVC directory.