Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Linking DLLs

bliefernicht
Beginner
412 Views
Hello,
I would like to use an existing dll.How can I link a dll with my routine?
Bye,
Jan.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
412 Views
Method 1). You need the .lib file which comes with .dll, and link your program with it. If it's written in another language, you need to examine exported routine names using dumpbin /exports or "Dependency Walker", and write INTERFACEs to routines, with ALIAS attribute.
Method 2). If you don't have the .lib, you can use "dynamic binding" with pointers to functions. Search this Forum for "GetProcAddress" -- there should be a plenty of samples (one CVF sample from AdvancedDll also demonstrates that, or see MAPI module on my home page).
In any case, you have to know routine prototypes (calling convention, return value, number and types of arguments) so that you can write INTERFACEs correctly, thus you need at least a piece of suitable documentation for the dll itself.
Jugoslav
0 Kudos
Reply