On 2/18/24 13:30, Eric Ribble wrote:
I am a new user of Qt (using version 6.6) and Qt Creator  I would like to use KArchive to extract all folders and files from a zip file.  I found the example "karchive/examples/unzipper/main.cpp" source code. However, I don't know how to download and install KArchive.

What distro are you using?

In order to install a library in such a way that you can use it in new programs, you have to install both it and its development header files. There are generally two ways to do this:

* The easy way - install the development header package for your library of choice through your distro's package manager. * The hard, dangerous way that you probably don't want yet - build the library from source and then either install it directly or figure out how to point your build system to it.

Obviously I'd recommend the former if you're just getting started. On Ubuntu, the package you want is called "libkf5archive-dev", and can be installed with "sudo apt install libkf5archive-dev". This will probably work on Debian too. If you're on some other distro, you'll need to find and install the right package.

I added the following to my project's "CMakeLists.txt" as described on the web page https://marketplace.qt.io/pages/karchiveinstructionspage :

find_package(KF5Archive)
target_link_libraries(Example4 KF5::Archive)

Attached is my "CMakeLists.txt" file and "Main.cpp" file.

In my "Main.cpp" the syntax-checker indicates that it can't find "kzip.h" (probably because I don't know how to download/install it).

Here is a screenshot after trying to build:

Inline image

Please advise on how to properly download/install KArchive so that this simple program will build.  Thanks for your help!

Eric Ribble


--
Aaron Rainbolt
Lubuntu Developer
Matrix: @arraybolt3:matrix.org
IRC: arraybolt3 on irc.libera.chat
GitHub:https://github.com/ArrayBolt3

Attachment: OpenPGP_0x84FC20D468BEFD4D.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to