- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Fortran EXE and several Fortran DLLs it links to in the same solution. Procedures are exported from the DLLs in modules by adding the DEC$ATTRIBUTES DLLEXPORT to them. They are consumed in the EXE by a USE module_name statement. When I compile individual routines in the EXE with the USE statement in, they compile fine - indicating I guess that they have found the exported module definitions ok. However, when I build the EXE the linker fails to link with the imported routines. If I explicitly add the .lib file for the DLL to the EXE project (using Add...Existing Item) then all is well and everything builds. However, if I only specify that the EXE depends on the DLL using "Project Dependencies" then it wont link.
Ultimately, this is not a big problem as I can use the .lib explicitly. I'm just rather bemused since I have some other DLLs in the solution which certainly have not had their .lib added explicitly in this way, and they link just fine. Makes me think I'm doing something stupid or missing something obvious. All of the EXE and DLLs output to to a single "Executables" directory. Can anyone think of anything obvious?
Cheers
Ranbir
Ultimately, this is not a big problem as I can use the .lib explicitly. I'm just rather bemused since I have some other DLLs in the solution which certainly have not had their .lib added explicitly in this way, and they link just fine. Makes me think I'm doing something stupid or missing something obvious. All of the EXE and DLLs output to to a single "Executables" directory. Can anyone think of anything obvious?
Cheers
Ranbir
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have seen this problem myself, but rarely. I do not know what causes it. You could try recreating the projects to see if that gets the dependency working, but it may be simpler to just add the library reference.

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