[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] libarchive

From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] libarchive
Date: Tue, 15 Jun 2010 18:39:29 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Natalie Tasman <address@hidden> schrieb:
> Here's a small test program for libarchive.

Thanks for that!

Your test program helped me to fix the issue:

> build: <gcc> -o libarchive-test.exe libarchive-test.c -I <include path>
> -L<lib path> -larchive

Okay, I took that as a base for the test script's build command.
Note that you need to add "-lz" when linking statically.

> libarchive-test.c:
> -- begin --
> /* This file is part of mingw-cross-env.       */
> /* See doc/index.html for further information. */
> #include <archive.h>
> #include <archive_entry.h>
> int main(int argc, char *argv[])
> {
>   struct archive *tgz;
>   tgz = archive_write_new();
>   archive_write_set_compression_gzip(tgz);
>   archive_write_set_format_ustar(tgz);
>   return 0;
> }

I performed some small changes [1] to your test program and included it.


[1] I removed the unused "#include <archive_entry.h>" and added
    a call to archive_write_finish(). I also made a small adjustment
    to make it compile without any warnings in pedantic ANSI mode.

Volker Grabsch
NotJustHosting GbR

reply via email to

[Prev in Thread] Current Thread [Next in Thread]