- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Help needed to resolve this, it's really frustrating.
When I link the included project to make a DLL file, a Warning LNK4217 message is displayed. This relates to the DLLexport command of a common block that is defined in a Module named GRAPHICS_BLOCK2. If I move the contents of this module into my subroutine, the error message does NOT appear.
In my source code that I have converted from Compaq Fortran, this module is accessed by many subroutines. Most of the time LNK4049 is the error that comes up instead of LNK4217. How can I eliminate these messages without repeating this code in all my subroutines?
When I link the included project to make a DLL file, a Warning LNK4217 message is displayed. This relates to the DLLexport command of a common block that is defined in a Module named GRAPHICS_BLOCK2. If I move the contents of this module into my subroutine, the error message does NOT appear.
In my source code that I have converted from Compaq Fortran, this module is accessed by many subroutines. Most of the time LNK4049 is the error that comes up instead of LNK4217. How can I eliminate these messages without repeating this code in all my subroutines?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The title of your post says "Error" but I see a "Warning". Is something I don't see preventing the DLL from building?
The 4217 warning will occur if your DLL contains a module that DLLEXPORTs something and you USE the module in the DLL. When you use a module that has a DLLEXPORT, that turns into a DLLIMPORT. The linker is saying "you told me that /GRAPH/ was DLL imported but I see the object code for it right here." You can ignore this, or if it REALLY bothers you, add /ignore:4217 to the linker options.
The reason the compiler does this is partly because MSFPS did and partly because it's a good idea. It allows you to take the same .mod file you generate when building the DLL and using it for the consumers of the DLL. Otherwise you'd need to build two different versions, one with DLLIMPORT and one without.
LNK4049 is a variant of this same warning and can also be ignored. I think which you get depends on the order the linker sees the objects.
The 4217 warning will occur if your DLL contains a module that DLLEXPORTs something and you USE the module in the DLL. When you use a module that has a DLLEXPORT, that turns into a DLLIMPORT. The linker is saying "you told me that /GRAPH/ was DLL imported but I see the object code for it right here." You can ignore this, or if it REALLY bothers you, add /ignore:4217 to the linker options.
The reason the compiler does this is partly because MSFPS did and partly because it's a good idea. It allows you to take the same .mod file you generate when building the DLL and using it for the consumers of the DLL. Otherwise you'd need to build two different versions, one with DLLIMPORT and one without.
LNK4049 is a variant of this same warning and can also be ignored. I think which you get depends on the order the linker sees the objects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I can assume that the dll created is a genuine one and not going to cause me any problems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correct.

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