Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Help me to compile a packzip tools

Featured Replies

  • Author
  • Localization

TUNBudi06, posted Thu Oct 07, 2021 11:38 am (66894)


Hai bro,i don't know why when i compile your tool for termux with architecture arm or aarch64 i always found 3 warning and for error



This the logs of my console
~/packzip $ make
cc -O2 -c libs/7z_advancecomp/*.cc
cc -O2 -c libs/lzma/LzmaDec.c libs/lzma/Lzma2Dec.c libs/lzma/Bra86.c libs/lzma/LzFind.c libs/lzma/LzmaEnc.c libs/lzma/Lzma2Enc.c -D_7ZIP_ST -D_7Z_TYPES_
cc -O2 -c libs/uberflate/uberflate.c
cc -O2 -c compression/advancecomp.cpp
cc -O2 -c compression/adler32.c
cc -O2 -c libs/zopfli/*.c
cc packzip.c -O2 -o packzip *.o -lstdc -lz -lm -static
packzip.c:288:48: warning: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types]
ZopfliCompress(&opt, type, in, insz, &out, &outsz);
^~~~~~
./libs/zopfli/zopfli.h:91:50: note: passing argument to parameter 'outsize' here
unsigned char** out, size_t* outsize);
^
packzip.c:336:89: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
else { free(out_data); out_data = myzopfli(in_data, in_size, &ret_t, ZOPFLI_FORMAT_ZLIB); ret = ret_t; }
^~~~~~
packzip.c:273:37: note: passing argument to parameter 'ret_outsz' here
u8 *myzopfli(u8 *in, int insz, int *ret_outsz, int type) {
^
packzip.c:342:89: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
else { free(out_data); out_data = myzopfli(in_data, in_size, &ret_t, ZOPFLI_FORMAT_DEFLATE); ret = ret_t; }
^~~~~~
packzip.c:273:37: note: passing argument to parameter 'ret_outsz' here
u8 *myzopfli(u8 *in, int insz, int *ret_outsz, int type) {
^
packzip.c:486:37: error: function definition is not allowed here
void *SzAlloc(void *p, size_t size) { return(real_calloc(size, 1)); } // xmalloc doesn't return in case of error
^
packzip.c:487:37: error: function definition is not allowed here
void SzFree(void *p, void *address) { if(address) real_free(address); }
^
packzip.c:488:22: error: use of undeclared identifier 'SzAlloc'; did you mean 'g_Alloc'?
ISzAlloc g_Alloc = { SzAlloc, SzFree };
^~~~~~~
g_Alloc
packzip.c:488:10: note: 'g_Alloc' declared here
ISzAlloc g_Alloc = { SzAlloc, SzFree };
^
packzip.c:488:31: error: use of undeclared identifier 'SzFree'
ISzAlloc g_Alloc = { SzAlloc, SzFree };
^
3 warnings and 4 errors generated.
make: *** [Makefile:14: all] Error 1


Please fix it


Oh ya btw i give little change for the makefile but it still cant please help
  • Author
  • Localization

aluigi, posted Wed Oct 13, 2021 10:08 am (66994)


For the first warning it's enough to declare outsz at line 274 as size_t.

For the second warning replace "int *ret_outsz" with "size_t *ret_outsz" at line 273.

For the others try moving the 3 lines at line 486 to line 483 (before the beginning of the lzma_compress function)
  • Author
  • Localization

TUNBudi06, posted Thu Oct 14, 2021 10:41 am (67021)


Help me.cause i want to compiled the packzip for termux has error 4 warning three

Code:
~ $ cd /sdcard/packzip
/sdcard/packzip $ make
cc -s -O2 -fstack-protector-all -c libs/7z_advancecomp/*.cc
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/lzma/LzmaDec.c libs/lzma/Lzma2Dec.c libs/lzma/Bra86.c libs/lzma/LzFind.c libs/lzma/LzmaEnc.c libs/lzma/Lzma2Enc.c -D_7ZIP_ST -D_7Z_TYPES_
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/uberflate/uberflate.c
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c compression/advancecomp.cpp
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c compression/adler32.c
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/zopfli/*.c
clang-12: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc packzip.c -s -O2 -fstack-protector-all -o packzip *.o -lstdc -lz -lm -static
packzip.c:288:48: warning: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types]
    ZopfliCompress(&opt, type, in, insz, &out, &outsz);
                                               ^~~~~~
./libs/zopfli/zopfli.h:91:50: note: passing argument to parameter 'outsize' here
                    unsigned char** out, size_t* outsize);
                                                 ^
packzip.c:336:89: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
        else                    { free(out_data); out_data = myzopfli(in_data, in_size, &ret_t, ZOPFLI_FORMAT_ZLIB);    ret = ret_t; }
                                                                                        ^~~~~~
packzip.c:273:37: note: passing argument to parameter 'ret_outsz' here
u8 *myzopfli(u8 *in, int insz, int *ret_outsz, int type) {
                                    ^
packzip.c:342:89: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
        else                    { free(out_data); out_data = myzopfli(in_data, in_size, &ret_t, ZOPFLI_FORMAT_DEFLATE); ret = ret_t; }
                                                                                        ^~~~~~
packzip.c:273:37: note: passing argument to parameter 'ret_outsz' here
u8 *myzopfli(u8 *in, int insz, int *ret_outsz, int type) {
                                    ^
packzip.c:486:37: error: function definition is not allowed here
void *SzAlloc(void *p, size_t size) { return(real_calloc(size, 1)); }  // xmalloc doesn't return in case of error
                                    ^
packzip.c:487:37: error: function definition is not allowed here
void SzFree(void *p, void *address) { if(address) real_free(address); }
                                    ^
packzip.c:488:22: error: use of undeclared identifier 'SzAlloc'; did you mean 'g_Alloc'?
ISzAlloc g_Alloc = { SzAlloc, SzFree };
                     ^~~~~~~
                     g_Alloc
packzip.c:488:10: note: 'g_Alloc' declared here
ISzAlloc g_Alloc = { SzAlloc, SzFree };
         ^
packzip.c:488:31: error: use of undeclared identifier 'SzFree'
ISzAlloc g_Alloc = { SzAlloc, SzFree };
                              ^
3 warnings and 4 errors generated.
make: *** [Makefile:14: all] Error 1
/sdcard/packzip $
  • Author
  • Localization

aluigi, posted Thu Oct 14, 2021 10:49 am (67022)


I already replied you here, why did you post in another topic on a different matter???
  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 2:09 pm (67794)


IM sorry.but it has another error

Code:
~/pz $ cd .. && rm -r pz && cp -r /sdcard/pz pz && cd pz && make
cc -s -O2 -fstack-protector-all -c libs/7z_advancecomp/*.cc
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/lzma/LzmaDec.c libs/lzma/Lzma2Dec.c libs/lzma/Bra86.c libs/lzma/LzFind.c libs/lzma/LzmaEnc.c libs/lzma/Lzma2Enc.c -D_7ZIP_ST -D_7Z_TYPES_
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/uberflate/uberflate.c
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c compression/advancecomp.cpp
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c compression/adler32.c
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc -s -O2 -fstack-protector-all -c libs/zopfli/*.c
clang-13: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
cc packzip.c -s -O2 -fstack-protector-all -o packzip *.o -lstdc -lz -lm -static
packzip.c:288:49: error: use of undeclared identifier 'outsz'; did you mean 'puts'?
    ZopfliCompress(&opt, type, in, insz, &out, &outsz);
                                                ^~~~~
                                                puts
/data/data/com.termux/files/usr/include/stdio.h:135:5: note: 'puts' declared here
int puts(const char* __s);
    ^
packzip.c:290:32: error: use of undeclared identifier 'outsz'; did you mean 'puts'?
    if(ret_outsz) *ret_outsz = outsz;
                               ^~~~~
                               puts
/data/data/com.termux/files/usr/include/stdio.h:135:5: note: 'puts' declared here
int puts(const char* __s);
    ^
2 errors generated.
make: *** [Makefile:14: all] Error 1
~/pz $
  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 2:37 pm (67795)


Ok now, IM done with it.i do
1.line 274 i don't changed it cause it Will make error
Code:
 outzs not recognize it.do you mean putzs 


2.i changed the Makefile. I delete the static option
Code:
 EXE      = packzip
CFLAGS    = -s -O2 -fstack-protector-all
PREFIX   = /usr/local
BINDIR   = $(PREFIX)/bin
SRC      = $(EXE).c

all:
   $(CC) $(CFLAGS) -c libs/7z_advancecomp/*.cc
   $(CC) $(CFLAGS) -c libs/lzma/LzmaDec.c libs/lzma/Lzma2Dec.c libs/lzma/Bra86.c libs/lzma/LzFind.c libs/lzma/LzmaEnc.c libs/lzma/Lzma2Enc.c -D_7ZIP_ST -D_7Z_TYPES_
   $(CC) $(CFLAGS) -c libs/uberflate/uberflate.c
   $(CC) $(CFLAGS) -c compression/advancecomp.cpp
   $(CC) $(CFLAGS) -c compression/adler32.c
   $(CC) $(CFLAGS) -c libs/zopfli/*.c
   $(CC) $(SRC) $(CFLAGS) -o $(EXE) *.o -lstdc -lz -lm # -static

install:
   install -m 755 -d $(BINDIR)
   install -m 755 $(EXE) $(BINDIR)/$(EXE)

.PHONY:
   install

  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 2:38 pm (67796)


Thank aluigi,for helping me :D :D
  • Author
  • Localization

aluigi, posted Thu Dec 02, 2021 4:57 pm (67799)


At line 274 I said to declare outsz as size_t, from:
Code:
int     outsz   = 0;
to
Code:
size_t  outsz   = 0;
  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 6:18 pm (67802)


You said at line 273
  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 6:18 pm (67803)


Thanks,But now its work properly
  • Author
  • Localization

TUNBudi06, posted Thu Dec 02, 2021 6:23 pm (67804)


This the code
At line 273-274
Code:
 
u8 *myzopfli(u8 *in, int insz, size_t *ret_outsz, int type) {
    int     outsz   = 0;
    u8      *out    = NULL;


And line 484 until 487
Code:
void *SzAlloc(void *p, size_t size) { return(real_calloc(size, 1)); }  // xmalloc doesn't return in case of error
void SzFree(void *p, void *address) { if(address) real_free(address); }
ISzAlloc g_Alloc = { SzAlloc, SzFree };
int lzma_compress(u8 *in, int insz, u8 *out, int outsz, int flags) {



And i changed the Makefile deleting the --static option
Bc when try to compile it
It has error dont find library file -lz -lm
  • Author
  • Localization

aluigi, posted Fri Dec 03, 2021 11:06 am (67821)


Cool, so is it ok now?

No idea why -static doesn't link to -lz (zlib) and -lm (math), anyway that's only good for sharing a static binary, it's not good for local compiling (probably I left it by mistake or because I planned to release a pre-compiled binary)
  • Author
  • Localization

TUNBudi06, posted Sun Dec 19, 2021 11:12 am (68362)


Yeah,its ok
  • Author
  • Localization

TUNBudi06, posted Sun Dec 19, 2021 11:13 am (68363)


Yeah,its ok now
Its work well

Thanks
  • Author
  • Localization

TUNBudi06, posted Sun Dec 19, 2021 11:14 am (68364)


Yeah,its ok now
Its work well

Thanks
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.