X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=B/kyvA1
	p892hNsR4MWKISwR4zoZjPFVlp/qv+42x+mfoOOhLHlLEEpYnzAwEUCxAF/o0+a5
	DZvsnf9JL7vaAYuf/L3Mb/4yxTIe2GlzMZLiEqhC+zx85K7LQCGoSKCqudyoRKp/
	Lgdak53r1ShQfFndDCwM41ugMp1YkStaQMAU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; s=default; bh=6wooJMb/vER+0
	2kbvO+hR5FMmpI=; b=w9JOwl8MKZWDZeoitQvdirt0AwKtUJvj4B5QLmHQvsncl
	t7LUA9mBcprgsjqgpowFnCneiW4dU1nMbbv9i3DwOvuDKnWXtP6JYGEOMx9RvwwX
	+GKQ/e/Go3F6lz6xiKKrYlz/66i5XERBZOgUbGCzVPLsT8xev7g2TrRs1a/xhU=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=mistaken, UD:t-d001071.o, t-d001062.o, td001060o
X-HELO: mail-qt0-f172.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:mime-version:in-reply-to:references:from:date         :message-id:subject:to;        bh=UvORj2a/iSYrhaEVGvs7GT7x4BR5rtOSksZDTqh62H8=;        b=N2ef0j18HLQ7vzGgwHilLzLGBJNNQHU25w0agStaFMbJzfIvzB9uan39fs5tep7h7f         phbs/+3zzNBpsJqhGxhKj1O4UUTOsdgDWzWFyEKCpZm8L8B00BzGre30OhVkZGmRlE9F         zT5MqOfBxHTAuvfU/MoSXwjdh1k1g59kZZBBdnfZ7W7rb3ofFk5bBCuxVgzFbR5m/mO0         tmu3wY1QNFvqf37YqJpnX87YXOJ+DlWF8P6kvImoLzMx6xqK9zFOUyFTbUmisF9KhJfb         Bt8kbDqnn/HID/LEXKcncS/Igyr8qi1p11sT8C4MlbSXN86aUkFq9pogtNZNKjM92urz         /nuQ==
X-Gm-Message-State: AIVw111PNicJDnmPFkjT/VoQQz39UoF9S5uE0rPPqA4IHLsMnOwzQ6tc	snMZZFpX0Tiv47U4E6MDC/saNfKRzPoz
X-Received: by 10.200.42.181 with SMTP id b50mr4900945qta.122.1500559656151; Thu, 20 Jul 2017 07:07:36 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <59700a43.482cca0a.52c69.999a@mx.google.com>
References: <CAM9TqJ75_0nyEn-2bpGUP90rJCD3bUmZKEj_6+fRh77jtkDSxQ@mail.gmail.com> <59700a43.482cca0a.52c69.999a@mx.google.com>
From: J <progman3k@gmail.com>
Date: Thu, 20 Jul 2017 10:07:35 -0400
Message-ID: <CAM9TqJ6Bphu2WBcWrF3s1g=VxwOQxEBR1MdvLM6J8hHNg7RZug@mail.gmail.com>
Subject: Re: Link error with static version of zlib?
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes

Hello Steven,

    Thank you very much for taking the time to reply to my question!

I downloaded
http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.8-9-any.pkg.tar.xz

I then copied the file libminizip.a contained within to
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/
I also copied the file libz.a contained within to
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/
making sure to rename the original file to libz.a.old so I can undo,
if necessary.

The rationale for doing this is that those two files are the only two
dependencies outside of the Windows system dlls the project uses.

However, at the link, there was still an error:

/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libminizip.a(unzip.o):(.text+0x13b9):
undefined reference to `BZ2_bzDecompress'
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libminizip.a(unzip.o):(.text+0x1605):
undefined reference to `BZ2_bzDecompressEnd'
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libminizip.a(unzip.o):(.text+0x1d65):
undefined reference to `BZ2_bzDecompressInit'
/usr/lib/libpthread.a(t-d001060.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_getspecific'
/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_key_create'
/usr/lib/libpthread.a(t-d001063.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_key_delete'
/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_mutex_destroy'
/usr/lib/libpthread.a(t-d001067.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_mutex_init'
/usr/lib/libpthread.a(t-d001068.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_mutex_lock'
/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_mutex_unlock'
/usr/lib/libpthread.a(t-d001101.o):fake:(.text+0x2): undefined
reference to `__imp_pthread_setspecific'


I've tried linking the thread library, but it does not seem to make a
difference.

I'm not sure how to proceed.

On Wed, Jul 19, 2017 at 9:41 PM, Steven Penny <svnpenn@gmail.com> wrote:
> On Wed, 19 Jul 2017 11:07:42, J wrote:
>>
>> If I am not mistaken, when selecting the package mingw64-x86_64-zlib
>> with the installer, it installs the library, which has been compiled
>> as both a DLL and a static library.
>>
>> But it appears that the minizip library included within the zlib
>> package is only present in DLL form.
>
>
> 1. mingw64-x86_64-zlib package does not include minizip
>
>        $ sage listfiles mingw64-x86_64-zlib
>        usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.a
>        usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.dll.a
>
> 2. mingw64-x86_64-zlib doesnt even pull in the minizip package:
>
>        $ sage-cost.sh mingw64-x86_64-zlib
>           73,920 desktop-file-utils
>           52,608 gamin
>          478,080 gsettings-desktop-schemas
>           11,592 libfam0
>        2,885,964 libglib2.0_0
>          693,532 libxml2
>           56,616 mingw64-x86_64-pkg-config
>          109,828 mingw64-x86_64-zlib
>           56,536 pkg-config
>          299,232 shared-mime-info
>
> 3. The package you are looking for is mingw64-x86_64-minizip, which doesnt
> get
>   pulled in from anything:
>
>        $ sage rdepends mingw64-x86_64-minizip
>        mingw64-x86_64-minizip
>
>   you have to manually install it.
>
> 4. You are rigth about the DLL:
>
>       $ sage listfiles mingw64-x86_64-minizip
>       usr/x86_64-w64-mingw32/sys-root/mingw/bin/libminizip-1.dll
>       usr/x86_64-w64-mingw32/sys-root/mingw/lib/libminizip.dll.a
>
> If you want the static version, you need to build it yourself, or post issue
> here:
>
> http://github.com/cygwinports/mingw64-x86_64-zlib
>
> Good luck on this though:
>
> - http://github.com/cygwinports/mingw64-x86_64-lua/issues/1
> - http://github.com/cygwinports/mingw64-x86_64-nghttp2/issues/1
> - http://github.com/cygwinports/mingw64-x86_64-pcre/issues/1
> - http://github.com/cygwinports/mingw64-x86_64-expat/issues/1
>
> Alternatively you can get it from here:
>
> http://repo.msys2.org/mingw/x86_64
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

