Menu

Integrate 7z in C++apllication in Mac and Linux

Help
2024-02-05
2024-02-13
  • Dharmendra Chaudhary

    Hi All,

    I wan to integrate 7z in my c++ application on window, mac, linux. for window i found sdk to integrate. For mac and linux found sdk (21.02 alpha: macOS and Linux support. Speed optimizations.) https://7-zip.org/sdk.html the link says 21.02 alpha supports macOS and Linux but could not find the library for the same. Found the source code for the same https://sourceforge.net/projects/sevenzip/files/7-Zip/21.02/
    I could not find the steps to build and integrate on mac and linux. Can anyone plese help me with the steps for building and integrating 7z in to a C++ apllication in MAc and linux. Any reference documents are welcome

     
  • Igor Pavlov

    Igor Pavlov - 2024-02-05

    7-zip works in mac and in linux.
    So 7-zip is example of such program.
    "7-zip client" part of 7-zip calls another parts of 7-zip for compession / extraction.
    The following code is simplified code of client for some features:

    CPP\7zip\UI\Client7z\
    

    But 7-zip itself is full example that implements more features.

    you can include C++ files to your project.
    or you can compile ".so" file and call functions via so file as Client7z does.

     

    Last edit: Igor Pavlov 2024-02-05
  • Igor Pavlov

    Igor Pavlov - 2024-02-06
    CPP\7zip\UI\Client7z\
    
     
  • Dharmendra Chaudhary

    @ipavlov, will CPP\7zip\UI\Client7z\ work on MAc and Linux

     
  • Igor Pavlov

    Igor Pavlov - 2024-02-06

    full 7-zip works in mac and in linux.
    so full 7-zip is full example.
    CPP\7zip\UI\Client7z\ is simplified example. It can works with dynamic linking. But that code can be changed for static linking too, if you need it.

     
  • Igor Pavlov

    Igor Pavlov - 2024-02-06

    full 7-zip works in mac and in linux.
    so full 7-zip is full example.
    CPP\7zip\UI\Client7z\ is simplified example. It can works with dynamic linking. But that code can be changed for static linking too, if you need it.

     
  • Dharmendra Chaudhary

    @ipavlov, I am able to build 7z on MAc https://github.com/mcmilk/7-Zip/tree/master/C/Util/7z
    while exracting the .7z file , it is extracting to current executing directory. Can you please help me witht he change for extracting in the specified directory. What will be possible changes .

     
  • Igor Pavlov

    Igor Pavlov - 2024-02-13

    Change current directory or add folder prefix.

     
  • Dharmendra Chaudhary

    I want to modify the source to accept the folder prefix. was trying to check which part of the code to change. https://github.com/mcmilk/7-Zip/blob/master/C/Util/7z/7zMain.c.
    Any idea, in which line what code to add

     
  • Igor Pavlov

    Igor Pavlov - 2024-02-13

    think it yourself

     

Log in to post a comment.