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

How ? Constructing a program in IVF / VS2008, that accesses a DLL

erik2055
Beginner
440 Views
I took from the web a series of .F95 files, that I want to compile into a working program.
I simplify a bit:
I have A.f95, B.f95 and c.f95, each containing a complete SUBROUTINE and nothing but that. They must be compiled/linked into a library (say, LIB1), that gets called from the main program.
Then I have P.f85, which is the main program that CALLs A, B and C.
I want to compile P in a separate program, that accesses the library routines A,B and C in LIB1, because A,B and C will be needed in another program too.
I suppose LIB1 must be a DLL ? How do I do that ?
I tell P about LIB1 by the use of 'USE LIB1' just after PROGRAM ?
Do I make 2 projects in a Solution , one for P and one for (A,B,C) ?

0 Kudos
1 Reply
Steven_L_Intel1
Employee
440 Views
I don't see that you need a library at all. First, rename all the files to have .f90 file types. .f95 is non-standard and is not recognized by Intel Fortran. Just add all the sources, a, b, c and p to a Fortran Console Application project and build it.

If you did want to make a library, a static library would be easier. You would create a Fortran static library project and add a, b and c to it. The main program p would go in a Console Application project and the static library project would be added to the solution. Last, you would right click on the main program project, select Dependencies, and check the box to make the library a dependent of the main program. Now when the solution is built, the library will be built and linked in with the main program.
0 Kudos
Reply