#94 Import lib not generated with VC8

pending
None
5
2011-10-28
2007-05-17
MikeJM
No

When building libpng 1.2.18 as a dll using MSVC 8 it doesn't export an import library when building with PNG_BUILD_DLL defined. After looking around pngconf.h it appears that line 1303 which reads:

#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)

should perhaps read

#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && defined(PNG_NO_MODULEDEF)

I'm not sure as I see no documentation on the function or intent of MODULEDEF but the current version is causing PNG_IMPEXP to be defined to nothing and which means nothing is exported and the VC linker helpfully skips generating the import lib which breaks my build.

Thanks,

Michael Marcin

Discussion

  • Logged In: YES
    user_id=300680
    Originator: NO

    I think we had similar problem with our MinGW builds. We had to add:
    #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
    # ifndef PNG_NO_MODULEDEF
    # define PNG_NO_MODULEDEF
    # endif
    #endif
    in front of the incriminated line.

     
  • Logged In: YES
    user_id=300680
    Originator: NO

    I think we had similar problem with our MinGW builds. We had to add:
    #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
    # ifndef PNG_NO_MODULEDEF
    # define PNG_NO_MODULEDEF
    # endif
    #endif
    in front of the incriminated line.

     
  • Logged In: YES
    user_id=798735
    Originator: NO

    it works fine with the provided cmake script.

     
    • assigned_to: nobody --> glennrp
     
    • status: open --> pending
     
  • Does this problem still exist in libpng-1.4.8 or libpng-1.5.6rc03?