LZMA SDK

Mar 21, 2010 at 12:04am
I am trying to use LZMA SDK to compress a file in my program. I have download the SDK but I don't know how to use it. Can anyone tell me what steps I need to take to make this work? Any help would be highly appreciated

I am almost a newbie to C and C++ world
Mar 21, 2010 at 1:04am
Find your compiler's "include" directory. Add a subdirectory called "lzma" and put the lzma header files there.

Find your compiler's "lib" directory. Copy the lzma .lib and .a files there.

#include <lzma/lzma.h> , etc as appropriate. (I've not used it so I don't know the names of all the include files, but they'll be something like <lzma/foo.h>.

Compile as usual. If you dynamically link, make sure to copy the lzma DLLs along with your application.

These are general guidelines.

Hope this helps.
Mar 21, 2010 at 2:16am
Actually, the LZMA SDK is pretty hard to use. A newbie is very unlikely to get it to work.
I'd suggest BZip2 as a simpler alternative for compression. If LZMA is a requirement, I have a couple sources here that simplify the process, but they still need some editing if you're going to compress and decompress in the same program.
Mar 21, 2010 at 1:36pm
Yeah it looks pretty difficult. By the way, there is a command line version of LZMA called 7za.exe and I can compress a file in the run time using system() command so is it possible to somehow embed this exe file in my own program and use it?? Maybe I should ask this in a new thread
Mar 21, 2010 at 2:02pm
apparently there is CreateProcess() but I don't know how to use it and if it can be used with simple console programs
Topic archived. No new replies allowed.