Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <4010C061.80503@susiraja.net>
Date: Fri, 23 Jan 2004 08:34:09 +0200
From: Jani Tiainen <jani.tiainen@susiraja.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
MIME-Version: 1.0
To: Cygwin List <cygwin@cygwin.com>
Subject: Re: undefined symbols in dlls?
References: <Pine.LNX.4.44.0401222216070.26257-100000@localhost.localdomain>
In-Reply-To: <Pine.LNX.4.44.0401222216070.26257-100000@localhost.localdomain>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

vikramshrowty@yahoo.com wrote:

> Hi,
> 	Aren't dlls alowed to  have undefined symbols?
> --------------
> foo.c:
> 
> int bar();
> 
> int foo() {
>   return bar();
> }
> --------------
> 
> When I try to compile foo.c like this...
> gcc -shared -o foo.dll foo.c
> 
> I get an error message complaning that '_bar' is undefined.

Funny, this pops up again and again.. =)

Maybe this should be in FAQ (if it isn't already there).

Well answer is no. DLL's aren't allowed to have unbounded undefined 
symbols. There is few ways to get this over, see message thread "DLL and 
external symbols" started by me and "DLL vs. shared object linking 
behavior" started by Karl Robillard.

- Jani Tiainen

--
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/

