7-Zip-zstd
7-Zip-zstd copied to clipboard
Linux build problem
I was trying to build 7za
within the 7-Zip-zstd/CPP/7zip/Bundles/Alone
folder, but the final linking (zstd
library) always fails:
/usr/bin/ld: _o/ZipAddCommon.o: in function `NArchive::NZip::CAddCommon::Compress(ISequentialInStream*, IOutStream*, bool, bool, unsigned int, unsigned long long, ICompressProgressInfo*, NArchive::NZip::CCompressingResult&)':
ZipAddCommon.cpp:(.text+0x1958): undefined reference to `NCompress::NZSTD::CEncoder::CEncoder()'
/usr/bin/ld: _o/ZipHandler.o: in function `NArchive::NZip::CZstdDecoder::CZstdDecoder()':
ZipHandler.cpp:(.text+0x1e29): undefined reference to `NCompress::NZSTD::CDecoder::CDecoder()'
collect2: error: ld returned 1 exit status
I had " pathTo/zstdmt/programs/zstd/lib/libzstd.a" added to the link command g++ -o _o/7za -s -DNDEBUG _o/7zStream.o _o/Alloc.o ... -lpthread -ldl
, but no avail.
The make command is per the standard document:
make -j makefile.gcc
gcc/++ version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Actually I figured out that the ZstdEncoder.o
and ZstdDecoder.o
were not built, with which the build becomes successful. But now the problem is that the built 7zz
is not handling new codec properly, either -m0=ZSTD
or -m0=FLZMA
doesn't work, while -m0=LZMA
works fine.
Can you add some more work on it and provide some pull request with the needed changes? I would like to have some building also on linux... but my time is currently very limited.
I am not familiar with Github code management, not sure what I should do...
https://www.7-zip.org have "full" standalone version for linux: 7zzs
. It builds without problems.
and have a new plan to add zstd: https://sourceforge.net/p/sevenzip/feature-requests/1580/
https://github.com/p7zip-project/p7zip (with zstd) also successfully builds on linux
I want the same thing for this project 7-Zip-zstd Alone2 (7zz)