Load of libgfle311.dll fails if libgfl311.dll was renamed

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

User avatar
AmigoJack
Posts: 33
Joined: Tue Mar 09, 2010 6:40 pm

Load of libgfle311.dll fails if libgfl311.dll was renamed

Post by AmigoJack »

(I found this out while having two DLLs with the same name but different content)

We have both DLLs: libgfl311.dll and libgfle311.dll. Loading both in a programs works as expected.
  • If I rename libgfl311.dll to (for example) gfl.dll and only load this first DLL (and never libgfle311.dll) everything works as expected: I have all the basic functions.
  • However, if that first DLL was renamed to (for example) gfl.dll and I try to also load libgfle311.dll this DLL itself raises the Win32 error 126 (0x7E, "module not found"). That brings up a typical MsgBox with a text refering to the fact, that "libgfl311.dll" could not be found. This means libgfle311.dll itself relies to libgfl311.dll - and it must be this name!
    So I conclude the sourcecode for libgfle311.dll imports functions from libgfl311.dll by static linking on the fixed name "libgfl311".
  • If I do not rename the first DLL (name stays libgfl311.dll) and change the name of libgfle311.dll to (for example) gflextra.dll and load both DLLs it also works as expected. Surely because the second DLL only refers to the first one (which is not renamed, hence found by the constant text "libgfl311"). And because nothing refers to the second DLL it also works to rename that DLL and load it, having all extended functions working in the program.
But I understand that this is really a very specific "problem" which will rarely deny a scenario. The only limitation of is that you must never rename libgfl311.dll if you also plan to use libgfle311.dll. Of course there is the possibility of directly editing libgfle311.dll and changing the text "libgfl311.dll" into your chosen name of the first DLL.

The best solution would be if libgfle311.dll would not rely on libgfl311.dll at all.

However, this is really a very low priority issue. Think about it, if you are very bored, Pierre :)