Click here to Skip to main content
13,054,615 members (63,724 online)
Rate this:
Please Sign up or sign in to vote.
I am trying to build a little application using libzip library. I downloaded and compiled libzip with assistance of this article:

The problem is that it compiles libs dynamically, requiring both zlib.dll and zip.dll to be present. I want to compile the application completely statically, so no additional dlls will be required. does someone know how I can do that?

Posted 2-Apr-13 1:46am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can only do that if you have the complete source code for everything you want in your final exe.
If you have then the simplistic answer is to put all the source code in one project and just build the one exe.
You could of course build the zlib and zip parts as static libraries and then link these into your exe.
It looks from the item you linked as if you're using CMake to do this. If that's the case you really need to put CMake in the title of the question or at least make it very clear if that's what you want help with CMake is pretty specialist.

Otherwise however you do this you're going to need to create one or more new 'projects' of some form, Make file or IDE to get the job done. Do one for an essentially empty executable or 'Hello World' application first and once that works perhaps try zlib as a static library.
Post the details if you get stuck.
5ed. And the source code of LibZip is available, of course.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100