#165 Compatibility issue using FreeImage 3.14.1

Hervé Drolon

I'm using FreeImage library in my developed .NET application Sharp IMG Viewer available from http://sites.google.com/site/sharpimg/viewer. Testing my application in Windows 98/Me environment I found an error opening image files calling PInvoke methods:

Unable to load DLL 'FreeImage'. A device attached to the system is not functioning (Exception from HRESULT: 0x8007001F)

This issue is specific for 3.14.1 version of FreeImage.dll from http://downloads.sourceforge.net/freeimage/FreeImage3141Win32.zip. Replacing the file FreeImage.dll to older version 3.13.1 image files are opened successfully. There are no problems using FreeImage.dll in Windows XP/Vista/7 environment also.
Please answer if you could resolve this issue in the future FreeImage releases.


  • Hervé Drolon
    Hervé Drolon

    Maintenance of the C# wrapper has been stopped since one year.
    All I can say is that I will be happy to add any patch to the CVS if you can provide such a patch.
    In other words, any help to improve the C# wrapper is welcome :)


  • Mike

    Please note C# wrapper isn't used calling FreeImage methods. I started Sharp IMG Viewer project when FreeImage.NET project was not developed. Therefore FreeImage.dll methods are called directly via PInvoke. My question is related with FreeImage.dll only. May be you used another compiler translating 3.14.1 version?

  • Mike

    I found the same issue testing FreeImage.dll 3.15.0.

  • Hervé Drolon
    Hervé Drolon

    I think I've found the problem :
    LibRaw use the ws2_32.lib, see
    and the line

    pragma comment(lib, "ws2_32.lib")

    This creates a dependency with the Windows Sockets 2 library (ws2_32.dll).
    This library uses some functions that are not present under Win98/Me.
    => You need to recompile FreeImage under Win98 in order to use it.

  • Mike

    I recompiled FreeImage 3.15.0 using Visual Studio 2005 and tested FreeImage.dll under Win98. I found no issues opening image files as well as RAW files (if free memory is available). I also tried to patch your distributed FreeImage.dll (as I understand built using Visual Studio 2008) with ExeVersion from http://www.steelbytes.com/?mid=47. Image files can be opened sometimes but there are other errors showing message boxes with thread errors. If you know another way to make FreeImage.dll compatible with Win98 please report me. I hope you will support project configuration for Visual Studio 2005 in the future.