gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
60 stars 50 forks source link

zzip/__hints.h problem #162

Closed staticmem closed 2 months ago

staticmem commented 2 months ago

I'm having problems building against this zzip:

Under the current Linux Mint 64 bit release I have installed this:

$ sudo apt-get install libzzip-dev

My testfile.c has:

include

include <zzip/memdisk.h>

.....

In file included from testfile.c:50: /usr/include/zzip/memdisk.h:12:10: fatal error: zzip/hints.h: No such file or directory 12 | #include <zzip/hints.h>

I don't understand what is causing this. It used to compile some years ago under a different system install.

Any solutions?

gdraheim commented 2 months ago

So the file /usr/include/zzip/__hints.h does exist? Then it is nothing more that the default includepath being diverted.

gdraheim commented 2 months ago

On the other hand, the __xy.h files were considered to be private, so that may have led to not get them installed which breaks if they referenced in public files. I'll check that - thanks for the report.

..... the usage of __hints.h in memdisk.h is quite old however. It crept in with 1e5b1ac48186e34e871945769623becfa3650956

staticmem commented 2 months ago

Yes /usr/include/zzip/__hints.h is there.

Edit: Sorry, No, it's not there.

I think this issue started after 2017 or so. Before that it had worked ok.

staticmem commented 2 months ago

Sorry, no the file is not there.

$ ls -l /usr/include/zzip/
total 128
-rw-r--r-- 1 root root  1373 Jan  5  2021 autoconf.h
-rw-r--r-- 1 root root  6076 Jan  5  2021 conf.h
-rw-r--r-- 1 root root  4996 Jun 21  2021 _config.h
-rw-r--r-- 1 root root 22474 Jan  5  2021 fetch.h
-rw-r--r-- 1 root root  1897 Jan  5  2021 file.h
-rw-r--r-- 1 root root 10239 Jan  5  2021 format.h
-rw-r--r-- 1 root root  4995 Jan  5  2021 fseeko.h
-rw-r--r-- 1 root root   567 Jan  5  2021 info.h
-rw-r--r-- 1 root root  2688 Jan  5  2021 lib.h
-rw-r--r-- 1 root root  6561 Jan  5  2021 memdisk.h
-rw-r--r-- 1 root root  3965 Jan  5  2021 mmapped.h
-rw-r--r-- 1 root root  6673 Jan  5  2021 _msvc.h
-rw-r--r-- 1 root root  3095 Jan  5  2021 plugin.h
-rw-r--r-- 1 root root  1862 Jan  5  2021 stdint.h
-rw-r--r-- 1 root root  1964 Jan  5  2021 types.h
-rw-r--r-- 1 root root   776 Jan  5  2021 wrap.h
-rw-r--r-- 1 root root  2360 Jan  5  2021 write.h
-rw-r--r-- 1 root root  1065 Jan  5  2021 zzip32.h
-rw-r--r-- 1 root root  8061 Jan  5  2021 zzip.h
staticmem commented 2 months ago

This is the package that was installed. I've list the file contents $ dpkg -c /var/cache/apt/archives/libzzip-dev_0.13.72+dfsg.1-1.1_amd64.deb | grep -i __hints.h Nothing

$ dpkg -c /var/cache/apt/archives/libzzip-dev_0.13.72+dfsg.1-1.1_amd64.deb | grep -i hints.h nothing

staticmem commented 2 months ago

I see you have fixed the problem. I grabbed the latest ZIP and checked the ChangeLog. I'm not use to using cmake but managed to build it and install it and now my app builds successfully. Now I just need to work out how to do cross compilations. Thanks for getting on to it so quickly.

gdraheim commented 2 months ago

I have updated the automake stuff as well but in any case it is best to use cmake as the build tool (or conan in the future). That's where the industry is moving to.

Thanks for the feedback. And yeah, I want to provide more examples how to do crosscompiling as well.

jamartis commented 2 weeks ago

Hello @gdraheim , not sure whether to open a new issue but it's quite related to this one. Quite a lot of the "bin" sources include the __foo.h "internal" header files. E.g. /bins/unzzip.c inludes:

#include <zzip/__debug.h>
#include <zzip/__mkdir.h>
#include <zzip/__param.h>
#include <zzip/__string.h>

Is this actually intended? The __foo.h files do not seem to be installed (see the ls output in one of the previous comments) by the make install and IIUC are supposed to be internal only. On the other hand, the unzzip.c source file mentions in the comment header: "This file is used as an example to clarify zzip api usage.", and yet it uses headers that are not part of the installed zziplib package and thus makes the unzzip.c (and the other bins/foo.c files) not really usable. In my opinion one of the following should be true:

  1. The bin/ source files should not include the __foo.h headers.
  2. The __foo.h files should be installed by make install.