- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a program that calls a dll. The dll is a collection of subroutines that when compiled generated a .lib and .dll file. It "exports" only one subroutine,I'll call "subx".I needed to wrap all the subroutines as a Module to make "re-use" of other existing modules withing "subx". The DLL compiles but no longer produces a .lib. I include "use module_subx" in the calling program but it gets an unresolved symbol. What calling program properties do I need to change so that it recognizes a "module" as opposed to a plain subroutine?
I use Fortran v11.1/VS2008
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to tell the project using the module that it needs to reference the .lib. One way to do this is, in the module, to add:
!DEC$ OBJCOMMENT LIB:'modlibname.lib'
where "modlibname" is the name of your DLL's export library.
Another way is to explicitly name the library in "additional dependencies" in the linker properties of the executable project.
Both of the above also require that the executable project add the path to the .LIB to "additional library directories".
Two other options are:
1) Make the DLL project a "dependent" project of the executable in the same solution
2) Add the .lib as "source file" to the executable project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes adding!DEC$ OBJCOMMENT LIB:'modlibname.lib' did the trick. This caused a .lib to be created. I dont understand why it stopped being created when I wrapped the subroutines in a Module. But with the .lib the calling program was able to recognize the subroutine.
Thank you
Felix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page