Subject: [2] Re: Building non-cygwin DLL with cyg-gcc
From: "Paul Garceau" <[email-masked]>
To: [email-masked]
Date: Mon, 19 Mar 2001 15:05:15 -0800

On 19 Mar 2001, at 12:32, the Illustrious Larry Hall (RFK Partners, Inc wrote:

> At 01:43 PM 3/18/2001, John Fortin wrote:
> > > There seem to be two methods of building DLLs, the User Guide method
> > > (invoke dlltool multiple times) and the recent Mailing List method
> > > (use the undocumented --output-implib ld switch).  If I do the ML
> > > method, I get
> > >
> > >   > gcc -Wl,--out-implib,file.a -shared -o file.dll file.o
> > >   Cannot export _bss_end__: symbol not defined
> > >   Cannot export _bss_start__: symbol not defined
> > >   Cannot export _data_end__: symbol not defined
> > >   Cannot export _data_start__: symbol not defined
> > >   Creating library file: Packet.a
> > >   collect2: ld returned 1 exit status
> > >   make: *** [main] Error 1
> >
> >I'll ask this again...  Is the above the expected result of using
> >-shared...(?).

	No.  In some cases the difference between what the switches "-shared" 
or "-mdll" does and can make a difference...try adding the following 
switch (either to your gcc line or use the "dlltool" command):
	"--export-all-symbols"

	and see how that works.

> > Why is ld trying to export _bss_* and _data_*. Is it a
> >requirement now to provide a .def file??  The mailing list archives
> >talk a bit around this issue.
> 
> 
>  From what I understand, you get this if you export everything.  In this
>  
> case, you can end up with things looking for more than is really there.
> A .def file stating exactly what you want to export resolves the
> situation. My description of the details of this issue may be flawed
> (and someone should correct me on these details), but I believe the
> solution I suggest here to this problem is sound.
> 
> 
> 
> Larry
> 
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
> 
> 

Nothing real can be threatened.
    Nothing unreal exists.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple