Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@sourceware.cygnus.com>
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Date: Sat, 13 Nov 1999 16:12:13 -0700 (MST)
From: Steve Jorgensen <steve@khoral.com>
Message-Id: <199911132312.QAA21084@zen.alb.khoral.com>
To: <nic@primordia.com>
Cc: <cygwin@sourceware.cygnus.com>
Subject: Re: Shared Libraries


> I've been told that shared libraries under unix can be built with unresolved
> externals. Thus, if I were to build a shared library with gcc under a
> unix/cygwin system, I would not need a stub library file containing the
> routines that I call within my library.

> The vendor have me a header file and a Win32 library file (.lib) and nothing
> else. The vendor states that under UNIX, no lib is needed. I can't figure
> out how to correctly link my shared library as gcc under cygwin still
> returns an "unresolved reference error".

> I have a vendor-provided header (vendor.h) defining some structures and
> functions. I compile my program like so:

> 	gcc -c my_module.c -o my_module.o
> 	gcc -shared -o my_module.so my_module.o

> I then get an "unresolved reference" error for each function defined in
> vendor.h that I call in my_module.c.

> Thanks (in advance) a MILLION for any help!

	Under windows, all shared libraries need ALL symbols resolved
	at link time, so you'll need to link in the .lib you got
	from you're vender.  Also, I don't think cygwin support
	traditional unix .so shared libraries.  You have to create DLL's,
	which have a magic (curse?) all their own.  They are considerably
	harder to create than Unix shared libraries, and have some
	extremely annoying limitations.  Poke around on
	http://sourceware.cygnus.com/cygwin for more information
	on creating DLL's.  The cygwin mailing list archives should
	have info too.. You're looking for information on DLL's, dllwrap,
	and dlltool.

						Steve
	


-----------------------------------------------------------
Steven Jorgensen      steve@khoral.com	    steve@haunt.com
------------------------------+----------------------------
Khoral Research Inc.          | PHONE: (505) 837-6500
6200 Uptown Blvd, Suite 200   | FAX:   (505) 881-3842
Albuquerque, NM 87110         | URL: http://www.khoral.com/
-----------------------------------------------------------

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

