#444 .def file directives throw link warnings

Test Required
closed-fixed
5
2007-05-11
2007-05-11
No

CVS Tag: R_2_0_0

libexpat.def and libexpatw.def for Windows DLL builds both include two elements that cause link warnings and in some cases, make the DLL unuseable at runtime.

The first line of each file, the LIBRARY directive, includes an explicit library name. This effectively prevents custom builds with a different DLL name. If you attempt to build a DLL with a different name, the linker will throw LNK4070 'filename directive differs from output filename' and the import lib will cause applications to link against the DEF LIBRARY DLL name instead of the actual DLL file name, which of course causes a "DLL not found" error at runtime.

To prevent this, that line should read just 'LIBRARY' with no name specified.

The next line is a DESCRIPTION directive. This line causes a LNK4017 warning 'statement not supported'. This directive has been deprecated for years in favor of version resources, and should be eliminated completely.

Discussion

  • Kevin J Bluck

    Kevin J Bluck - 2007-05-11

    Logged In: YES
    user_id=11142
    Originator: YES

    I would have generated a patch, but your CVS seems to be rejecting anonymous access at the moment. Strange, it wasn't doing that a couple days ago.

     
  • Karl Waclawek

    Karl Waclawek - 2007-05-11

    Logged In: YES
    user_id=290026
    Originator: NO

    Fixed in libexpat(w).dev rev. 1.8.
    Please check out and test.

    Karl

     
  • Karl Waclawek

    Karl Waclawek - 2007-05-11
    • milestone: 103319 --> Test Required
    • status: open --> open-fixed
     
  • Kevin J Bluck

    Kevin J Bluck - 2007-05-11

    Logged In: YES
    user_id=11142
    Originator: YES

    Yes, your removal of the explicit name from the LIBRARY directive works as expected.

    As I was working with tag R_2_0_0, I didn't notice previously that you already removed the DESCRIPTION directive in rev. 1.7, which was not part of that tag.

    There was no problem with the comment; you didn't have to remove that. It doesn't hurt anything either way.

     
  • Karl Waclawek

    Karl Waclawek - 2007-05-11
    • status: open-fixed --> closed-fixed
     
  • Karl Waclawek

    Karl Waclawek - 2007-05-11

    Logged In: YES
    user_id=290026
    Originator: NO

    OK, the comment is put back in. I guess I can close this as fixed.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks