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
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.
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.
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