This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
AW: dlltool not creating a proper import library
- To: "Binutils" <binutils at sources dot redhat dot com>
- Subject: AW: dlltool not creating a proper import library
- From: "Ralf Habacker" <Ralf dot Habacker at saght dot tessag dot com>
- Date: Tue, 5 Jun 2001 08:34:23 +0200
- Cc: "Andrew Begel" <abegel at eecs dot berkeley dot edu>
> Von: binutils-owner@sources.redhat.com
> [mailto:binutils-owner@sources.redhat.com]Im Auftrag von Andrew Begel
> Gesendet am: Dienstag, 5. Juni 2001 01:02
> An: binutils@sources.redhat.com
> Cc: abegel@cs.berkeley.edu
> Betreff: dlltool not creating a proper import library
>
> I'm try to use the Mingw32 dlltool to produce an import library from a
> .def file I've got. But, the generated import library seems to be
> missing a symbol that ld wants to see when it links the import library
> with my code.
>
> When gcc -shared creates a DLL and associated import library (using the
> -Wl,--outimp=libfoo.dll.a flag), for each exported symbol, in the
> libfoo.dll.a file there are three symbols. One is the original symbol
> _bar, the second is
> __imp__bar, and the third is __nm__bar.=20
>
> However, when I use dlltool to make an import library from a .def file,
> I only get two symbols for each exported symbol: _bar and __imp_bar.
> When I try to link a DLL from a static library that contains my
> generated import library (from the .def file), ld complains that
> I'm missing the __nm__bar symbol:
>
> i.e. nmth000000.o(.idata$4+0x0): undefined reference to `_nm__bar'
>
> Before this error, I get a warning about the symbol:
>
> Warning: resolving _bar by linking to __imp__bar (auto-import)
>
It seems that you are using an ld with the auto import option provided by
Paul Sokolvsky.
This ld contains an additional patch for skipping
__declspec(dllimport/dllexport)
Look at the sourceforge mingw project for additional information.
Ralf Habacker