Jump to content
msd

Delphi 11 & 12 LZMA Compression

Recommended Posts

Hello,

 

Does anyone use LZMA from System.Zip in Delphi 11 and 12?

I try it, but I get an error that this type of compression is not supported.

 

    Zip := TZipFile.Create;
    try
      Zip.Open(db.zipFile, zmWrite);
      Zip.Add(db.fbkFile, ExtractFileName(db.fbkFile), TZipCompression.zcLZMA );
      Zip.Close;
    except
    end;
	Zip.Free;

 

Thanks in the advance...

 

Share this post


Link to post

AFAIK the zlib library that TZipFile wraps does not support LZMA compression.

 

If you google for "delphi lzma" there's plenty of other solutions.

  • Thanks 1

Share this post


Link to post

Hello Anders,

 

I have an excellent solution for Delphi LZMA with extremely good compression and a very fast process, but it doesn't work under 64-bit environments.

This is my component for LZMA: https://github.com/ccy/delphi-zip. and if someone can check the 64-bit setup, it will be great.

 

Thanks to all in advance...

Share this post


Link to post

I'll give it a try, but there are some errors in OBJ files for x64 architecture.

If I do the job, I'll publish it on GitHub.

Share this post


Link to post

Hello,

 

What can be problem here, in 32bit everything works fine, but in 64 bit I have an error

 

unit Threads;

interface

uses System.Win.Crtl, Winapi.Windows, LzmaTypes, System.Classes;

type
  TCEvent = THandle;

  TCSemaphore = THandle;

  TCCriticalSection = TRTLCriticalSection;

  TCAutoResetEvent = TCEvent;

  TCThread = THandle;

  TThread_Func_Type = Pointer;

function{$IFDEF UNDERSCOREIMPORTNAME}__beginthreadex{$ELSE}_beginthreadex{$ENDIF}(__security_attr: Pointer; __stksize: Cardinal;
  __start: TThread_Func_Type; __arg: Pointer; __create_flags: Cardinal; var
  __thread_id: Cardinal): Cardinal; cdecl; external msvcrt name '_beginthreadex';

implementation

{$IFDEF Win32}
{$L Win32\Threads.obj}
{$ELSE}
{$L Win64\Threads.o}
{$ENDIF}

end.

 

Error is:

 

[dcc64 Error] Threads.pas(23): E2003 Undeclared identifier: 'msvcrt'

 

Thanks for the help and assistance in the advance...

Share this post


Link to post
36 minutes ago, msd said:

Error is:

 


[dcc64 Error] Threads.pas(23): E2003 Undeclared identifier: 'msvcrt'

Your obj files are compiled with VS C RTL, aka Microsoft Visual C++ Run Time, remove that dependency then rebuild it, and you will get rid of that error.

  • Thanks 1

Share this post


Link to post

Thanks to all supporters & friends, it is working fine now in 32bint/64bit.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×