This is the mail archive of the cygwin@cygwin.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]
Other format: [Raw text]

gcc/ld problem


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 <file>                Generate import library
  --output-def <file>                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/


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