delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/11/08:41:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 11 Jan 2002 14:33:39 +0100
From: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
X-Mailer: The Bat! (v1.53t) Business
Reply-To: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Organization: convey Information Systems GmbH
X-Priority: 3 (Normal)
Message-ID: <40100646702.20020111143339@familiehaase.de>
To: cygwin AT cygwin DOT com
Subject: gcc/ld problem
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019