- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Steve,
I want to create DLL of my fortran.f90 code. This code contains main program and subroutines, the structure is as follows:
program ABC
..
..
end program ABC
subroutine XYZ
..
..
end subroutine XYZ
subroutine PQ
..
..
end subroutine PQ
I have learnt that, we can add the code '!DEC$ ATTRIBUTES DLLEXPORT :: [subroutine_name]' and create a DLL for subroutines, but how can I do for the main program ABC?
Also when I try to use the above code for subroutines and build my solution, DLLs don't get created in my working folder. I dont know where am I going wrong.
Could you please help me in solving this? Any information would be greatly appreciated! Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Program unit cannot be in a DLL. A program unit creates an .EXE file not a .DLL file.
A DLL is made up of subprograms callable from other DLLs or other .EXE programs.
You are correct in having to EXPORT subprogram names in order for a list of callable subroutines to be created alongside the DLL, otherwise the subroutine names will not be visible to programs that load the DLL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to create a dll, you need to "new" a "Dynamic-link Library" project, then the output will be an .dll file when you build the solution. This project could not include the main program ("ABC" in your example).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony Richards wrote:
A Program unit cannot be in a DLL. A program unit creates an .EXE file not a .DLL file.
I think you mean "main program", not the much more general "program unit".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ha ir Ha ir Ha ir ?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page