Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A33B33C.1846BCBE@ece.gatech.edu> Date: Sun, 10 Dec 2000 11:45:48 -0500 From: "Charles S. Wilson" X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: s_c_biggs AT bigfoot DOT com CC: cygwin AT sources DOT redhat DOT com Subject: Re: weirdness with bz2 References: <3A32FBCB DOT 11591 DOT 298E255 AT localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Did you read /usr/doc/Cygwin/bzip2-1.0.1.README? The header file defines things so that you can link to libbz2.dll.a (the dll import lib) by default. ld/gcc will cooperate with that if you specify '-lbz2' on the link line: it searches for "lib.dll.a" BEFORE searching for "lib.a". If you use the header file but specify '/usr/lib/libbz2.a' as an explicit link dependency (rather than -lbz2) then you'll get symbol mismatch. To link with the static lib, do this: 1) when compiling, put '-DBZLIB_STATIC' on the compile line 2) when linking, use the '-static' option and specify '-lbz2'. -static will force the linker to ignore lib.dll.a and link with lib.a. To link with the dll, do this: 1) no special -D defines necessary 2) no special link options necessary, just specify '-lbz2' on the link line and let the linker do the work. --Chuck "Stephen C. Biggs" wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I am trying to link something with libbz2.a and am getting the > following errors: > undefined reference to `_imp__BZ2_bzopen' > undefined reference to `_imp__BZ2_bzdopen' > undefined reference to `_imp__BZ2_bzflush' > undefined reference to `_imp__BZ2_bzread' > undefined reference to `_imp__BZ2_bzerror' > undefined reference to `_imp__BZ2_bzwrite' > undefined reference to `_imp__BZ2_bzclose' > > ...basically the entire library. what am I doing wrong? The library is > there and so are the references (I dumped to to > make sure). > > -----BEGIN PGP SIGNATURE----- > Version: PGP 6.5.8 -- QDPGP 2.61c > > iQA/AwUBOjNsR7rbYfqpOoVxEQLpogCgyL4o04qFMc9LASSewrG2BZl99nsAn3CJ > FJrliJ3JYQwXTQ88+f4bpkQS > =Avp7 > -----END PGP SIGNATURE----- > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com