Re: Solved: Re: gcc/ld problem

2002-01-11 Thread Gerrit P. Haase

 Charles,

2002-01-11 18:30:44, du schriebst:

>> This question remains:
>>>Do I need .def files?

> No.

> BTW, why are you building a libz dll?  (Just for practice?)  There is 
> already a cygz.dll provided by the libz package...

No, I'm poking around with perl to get the cyg instead of the lib
prefix, and tested to use gcc -shared instead of dllwrap.

Well, then I'll skip the .def file anyway.


Gerrit
-- 
=^..^=


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: Solved: Re: gcc/ld problem

2002-01-11 Thread Charles Wilson

Gerrit P. Haase wrote:


> This question remains:
> 
> 
>>Do I need .def files?


No.

BTW, why are you building a libz dll?  (Just for practice?)  There is 
already a cygz.dll provided by the libz package...

--Chuck


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Solved: Re: gcc/ld problem

2002-01-11 Thread Gerrit P. Haase

 Gerrit,

2002-01-11 14:51:38, du schriebst:

Argh, after reading my own mail I saw the mistake:

> gcc -shared -o Zlib.dll -Wl,--out-implib=libZlib.dll.a
> -Wl,--output-def libZlib.def -Wl,--export-all-symbols
^ = is missing!!!
[...]
  
This question remains:

> Do I need .def files?


Gerrit
-- 
=^..^=


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




gcc/ld problem

2002-01-11 Thread Gerrit P. Haase

Hallo Cygwinners,

I'm trying to link a library with gcc -shared plus some ld options:

gcc -shared -o Zlib.dll -Wl,--out-implib=libZlib.dll.a -Wl,--output-def libZlib.def 
-Wl,--export-all-symbols -Wl,--enable-auto-import \
-L/usr/local/lib Zlib.o  
/usr/local/lib/perl5/5.7.2/cygwin-multi-64int/CORE/libperl.dll.a -L/usr/local/lib -lz
gcc: libZlib.def: No such file or directory

Now I'm getting this error.
I thought -Wl,--output-def name.def is the option to tell ld that it
should create this .def file, now I'm confused, why does it tell me
No such file or directory?

>From the ld --help output:
...
  --out-implib Generate import library
  --output-def Generate a .DEF file for the built DLL
...

And the .info says:
`--output-def FILE'
  The linker will create the file FILE which will contain a DEF file
  corresponding to the DLL the linker is generating.  This DEF file
  (which should be called `*.def') may be used to create an import
  library with `dlltool' or may be used as a reference to
  automatically or implicitly exported symbols.

  
It works well if I skip this flag.
It works well if I do a:
$ touch libZlib.def
before running gcc -shared.

Is this the expected way?
Do I have to create an empty .def file before linking?
Or is something with my setup broken?

Do I need .def files?


Gerrit
-- 
=^..^=


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/