delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/07/03:29:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <41B569CB.8030909@familiehaase.de>
Date: Tue, 07 Dec 2004 09:28:59 +0100
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
Organization: Esse keine toten Tiere
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; de-AT; rv:1.7.3) Gecko/20040910
MIME-Version: 1.0
To: robert AT fearthecow DOT net
CC: cygwin AT cygwin DOT com
Subject: Re: Suppressing linking errors with GCC/G++/ld under Cygwin
References: <1d7bdfaa04120618524bec0978 AT mail DOT gmail DOT com>
In-Reply-To: <1d7bdfaa04120618524bec0978@mail.gmail.com>
X-IsSubscribed: yes

Robert McLeay wrote:

> Hi,
> 
> (Sorry if this is OT, I'm trying to find out the Cygwin equivalent of
> a GCC flag from other platforms.)
> 
> I'm trying to compile a library for Qu-Prolog that will be linked at
> run-time with program internals. As it will be linked at run time, I
> would like to suppress all "undefined reference" errors somewhat
> similarly to using "-undefined suppress" under Mac OS X.
> 
> I'm using Cygwin, and here is the error message and the g++ line that I
> am using.
> 
> rob AT ches-laptop /cygdrive/c/rand2
> 
> $ g++ -shared -Wl,-soname,sym001476 $RAND2_LIB/rand.o  -lc -o sym001476
> 
> ../rand.o(.text+0x24f): In function `iunif_interface':
>    /    cygdrive/c/rand2/rand.cc:79: undefined reference to
> `Thread::unify(Object*, Object*, bool)'
> ../rand.o(.text+0x2ce): In function `iunif_interface':
>    /    cygdrive/c/qp-cygwin-withicm/src/heap_qp.h:278: undefined reference to
> `Heap::outOfSpace()'
> collect2: ld returned 1 exit status
> 
> Is there any way to suppress these errors and let it compile under
> Cygwin the same way as using "g++ -flat_namespace -undefined suppress
> -bundle" would under Mac OS X?

It is not possible to link a shared module / DLL or executable with
undefined references on Windows / Cygwin and so there is no switch to
enable this.  Symbols must resolve at link time.  If you need symbols
in a shared library then create and link against an importlib, if
symbols from an executable are needed then you try to figure out how to
create the executable so it exports these symbols, then create an import
library for these symbols and link against this importlib so the linker
is able to resolve the references at linktime.

Gerrit
-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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