This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: AW: Linking Dynamic Libraries


Charles Wilson wrote:
> 
> You still need to worry about things like __declspec(dllexport) and
> __declspec(dllimport).

What's the point of --export-all-symbols then? I was under the
impression that it was intended to duplicate the Unix convention, where
all external symbols are automatically exported from a .so. (Actually,
the help refers to "global" symbols, not "external", but I assumed that
just meant that whoever wrote the help didn't know C++.)

> As far as documentation, there's the mailing list, and 'ld --help' and
> Mumit's (really out-of-date) dll-helpers packaqe at
> http://www.xraylith.wisc.edu/~khan/software/gnu-win32/dllhelpers.html.
> Would you like to update that package for the current capabilities of
> ld/gcc ?

Sure, as soon as I figure out the details myself :-)

> NOTE 2: I used the extension '.dll.a' for the import library; cygwin's
> linker will search for 'libfoo.dll.a' in preference to 'libfoo.a';
> libfoo.a is assumed to be a static library (although the linker will use
> libfoo.a if .dll.a is not found)

Could you amplify please? I don't understand what you mean by this.
libfoo[.dll].a is a static link library. If I put -lfoo on the link
command, it looks for libfoo.a in accordance with the normal linking
procedure (even if a DLL implib has a different format to a normal
static library (I have no idea whether it does), the linker has no way
to know it's dealing with a DLL implib until after it's found and read
the file). If I don't put -lfoo on the link command, it has no reason to
look for foo dot anything. That's certainly the way all the system DLLs
work: if I want to use, say, wsock32.dll, I link with -lwsock32.

-- 
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"C++ is to programming as sex is to reproduction. Better ways might
technically exist but they're not nearly as much fun." -- Nikolai Irgens

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]