Find dll name corresponding to an import library

Warren Young warren@etr-usa.com
Thu Nov 7 01:46:00 GMT 2013


On 11/6/2013 15:31, Jean-Pierre Flori wrote:
>
> Is there a canonical way to do so?

The canonical way is to name your import libraries so that the name of 
the corresponding DLL is obvious.

Non-Cygwin import libraries are traditionally named after the DLL: 
foo.lib is for foo.dll.

Cygwin's stock build system is a bit different, due to POSIX naming 
norms, but the transform is simple: libfoo.a is for cygfoo.dll.

If you have an import library with a name that doesn't conform to one of 
these schemes, you might be able to dig the DLL name out of the library 
file.  Through some futzing around, I've discovered that this works:

     $ objdump -s foo.a | grep cyg.*dll$

That assumes that the DLL uses the "cyg" prefix.  Just grepping for 
"dll$" would be a better option if you weren't sure about even that.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list