public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: J <progman3k@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Link error with static version of zlib?
Date: Thu, 20 Jul 2017 14:16:00 -0000	[thread overview]
Message-ID: <CAM9TqJ6Bphu2WBcWrF3s1g=VxwOQxEBR1MdvLM6J8hHNg7RZug@mail.gmail.com> (raw)
In-Reply-To: <59700a43.482cca0a.52c69.999a@mx.google.com>

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

  reply	other threads:[~2017-07-20 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 15:47 J
2017-07-20 14:07 ` Steven Penny
2017-07-20 14:16   ` J [this message]
2017-07-21  0:32     ` Hans-Bernhard Bröker
2017-07-21 10:11       ` Steven Penny
2017-07-24 23:55         ` J (Jean-Claude Gervais)
2017-07-25 14:42           ` cyg Simple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM9TqJ6Bphu2WBcWrF3s1g=VxwOQxEBR1MdvLM6J8hHNg7RZug@mail.gmail.com' \
    --to=progman3k@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).