PDA

View Full Version : Compiling KArchive



Radek
17th June 2015, 20:02
without success, I need help of experienced.

I need .zip support in my app. In Qt4, it was simple: install kdelibs5-dev and link with libkdecore.so . Doing the same in Qt5 results in an immediate crash.

There is KArchive on inqlude. I downloaded it and tried to build it using included instructions. The build failed because I didn't have ECMConfig.cmake. Searching what it is all about, I have found I need extra-cmake-modules package, which isn't in the repository but which is on inqlude (in sources) - now without any instructions what to do with it. I tried to create a buid directory and commanded cmake .. from it. It failed, too, because I haven't something else. Oh well, install qttools5-dev and qttools5-dev-tools and cmake .. will pass. Now I seem to have ECMConfig.cmake but on a wrong place.

Q: Supposing cmake .. was a correct idea, where to copy the contents of the build directory of extra-cmake-modules?
Q: Will KArchive buid now? Or I need to install something before building?

In the meantime, I tried to make a Qt5 project from the KArchive sources and create a static library. With some problems, I was seemingly successful in the end. Linking the library with my app failed with unresolved external (init2) in a private header (kgzipfilter.h). So it isn't so simple. I also tried kdelibs5-dev again (in installs lots of Qt4, that's why I tried to avoid kdelibs5-dev) but with the known result (immediate crash).

Radek
18th June 2015, 06:08
Solution found. Do no lose nerves with compiling if you do not have framework environment installed. KArchive is in experimental repository (which you haven't subscribed if you use the stable environment). Search libkf5archive and libkf5archive-dev packages (.deb packages) on the web. Select a seriously looking source (for example, debian itself), download, ignore warnings on possible bugs (basic tasks like reading a .zip will work surely - and they do), and install. Add KArchive on the QT line of your project:


QT += core gui widgets KArchive

Done. You can compile apps with .zip support using KArchive API. No need of specifying additional libraries or includes. A big sigh of relief ;)