This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Windows ld bug/RFE with MSVC .libs
- From: Greg Couch <gregc at cgl dot ucsf dot EDU>
- To: bug-binutils at gnu dot org
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 9 Sep 2002 18:02:02 -0700 (PDT)
- Subject: Windows ld bug/RFE with MSVC .libs
The MinGW folks said to bug you guys at binutils, so here goes :-).
ld on Windows will successfully find exported functions in a Microsoft
Visual C++, MSVC, generated .lib to link against, but not exported
"DATA". So ld is unable to link to third-party libraries generated by
MSVC. I consider this behavior a bug as there is no workaround
possible with the utilities provided (please let me know if I'm wrong).
Either ld should not link against .lib's at all and a utility should
be provided to generate a .a from a .lib or ld should link against
all of the .lib.
For the record, I found a workaround, pexports -- a GPL'd program that
reads a .dll and generates a .def file (that dlltool can convert to
a .a) -- <http://starship.python.net/crew/kernr/mingw32/pexports-0.42h.zip>.
Please encorporate its magic into ld/nm. (And it would be even better if
-lname would look for name.lib in addition to libname.a.)
Thanks for your attention,
Greg Couch
UCSF Computer Graphics Lab
gregc@cgl.ucsf.edu