From: Andrew Begel <abegel@ee...> - 2001-06-02 02:22:43
Yet another question:
When a2dll creates a DLL and associated import library (using gcc
-shared), 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), a2dll (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)
In my .def, I have=20
listed on its own line,
bar is decorated with=20
extern __declspec(dllimport) int bar;=20
in its .h file, and my C++ code that includes this .h, references bar.=20
Is this something where dlltool didn't get changed in sync with gcc
-shared, or is there a flag I can pass to make this work?