Unable to build Krita ( qcompare ?)

I had to reinstall my Linux Mint system and found that I couldn’t run my previously built version of Krita any more. I’m running Linux Mint 19.1 currently. I first tried to build the source I had previously downloaded and failed (same error as below.) So I Started from scratch, using the instructions here, as I did before:

I’m running into this error when running make:

CMakeFiles/TestKoColor.dir/TestKoColor.cpp.o: In function `TestKoColor::testExistingSerializations()':
/home/hulmanen/krita5_beta_dev/krita/libs/pigment/tests/TestKoColor.cpp:142: undefined reference to `bool QTest::qCompare<unsigned char, int>(unsigned char const&, int const&, char const*, char const*, char const*, int)'
/home/hulmanen/krita5_beta_dev/krita/libs/pigment/tests/TestKoColor.cpp:143: undefined reference to `bool QTest::qCompare<unsigned char, int>(unsigned char const&, int const&, char const*, char const*, char const*, int)'
/home/hulmanen/krita5_beta_dev/krita/libs/pigment/tests/TestKoColor.cpp:144: undefined reference to `bool QTest::qCompare<unsigned char, int>(unsigned char const&, int const&, char const*, char const*, char const*, int)'
/home/hulmanen/krita5_beta_dev/krita/libs/pigment/tests/TestKoColor.cpp:205: undefined reference to `bool QTest::qCompare<unsigned char, int>(unsigned char const&, int const&, char const*, char const*, char const*, int)'
collect2: error: ld returned 1 exit status
libs/pigment/tests/CMakeFiles/TestKoColor.dir/build.make:115: recipe for target 'libs/pigment/tests/TestKoColor' failed
make[2]: *** [libs/pigment/tests/TestKoColor] Error 1
CMakeFiles/Makefile2:10538: recipe for target 'libs/pigment/tests/CMakeFiles/TestKoColor.dir/all' failed
make[1]: *** [libs/pigment/tests/CMakeFiles/TestKoColor.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  8%] Building CXX object libs/pigment/tests/CMakeFiles/TestColorConversionSystem.dir/TestColorConversionSystem.cpp.o
[  8%] Built target TestKoColorSpaceRegistry
[  8%] Linking CXX executable TestKoChannelInfo
[  8%] Built target TestKoChannelInfo
[  8%] Linking CXX executable TestConvolutionOpImpl
[  8%] Built target TestConvolutionOpImpl
[  8%] Linking CXX shared library libkritapsdutils.so
[  8%] Built target kritapsdutils
[  8%] Linking CXX executable TestColorConversionSystem
[  8%] Built target TestColorConversionSystem
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

Now, this is probably something I did wrong, since I was able to build before reinstalling my OS, but can anyone help me figure out what the problem is?

What is your cmake line? And what is your Qt version?

Could it be that after reinstalling your OS that the required version of QT is missing?

@takiro @tiar
I think the QT version might be it. I tried finding out what I have with ‘qmake --version’ and got “qmake: could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’: No such file or directory”.

So it can’t find qmake and is looking for the qt4 one anyway… I’ll look into this when I have time again, thank you.


apt build-dep krita

this will fetch and install all dependencies required to build krita. Of course this will install dependencies for stable version that is in the repository, other 2-3 dependencies which might have been added to the master branch you can install manually. Also for this command to work you need to enable the source repository in the apt source list.

This, I did do already

Looks like your qtchooser is set to Qt4 by default, while Qt4 is not actually installed (hardly surprising)…try qmake -qt=5 --version, but I bet it’s 5.9.something from Ubuntu 18.04 that Mint 19 is based on.

These errors can happen when you use Qt older than what krita uses for release builds, looking at those lines it seems there’s a type mismatch in the comparison, and newer Qt versions take care of implicit conversion.

But since this is a unit test, you don’t need to build those if you just want to use Krita, you can save a lot of time and disk space and just disable them by adding “-DBUILD_TESTING=OFF” to the cmake arguments.

@Lynx3d: That gives me 5.9.5 for QT version. The CMake step just says the required version is >=5.9.0, so it should be new enough based on that.

I think I’ll upgrade this system to Mint 20 first, then see if I still need to fix something.

QT 5.12 or higher is suggested. To get past the qcompare, you can manually cast the integers, but you will get later on stuck at the random number generator. Both those require at least QT 5.10

Ideally it should still work with 5.9, problem is only that none of the active developers still uses this older version, I think.

I’m not sure if anyone still actively tries to fix compile issues with 5.9, it’s kind of a Sisyphean task to fix every compatibility issue that was accidentally introduced…

Well, no problem, I’ve got no need to stick with this old version. If possible, perhaps cmake should throw an error here, though.

You can also compile while skipping the tests and hope for the best, some of these errors are on the tests and may not be a problem with the compilation itself.

So after quite an odyssey, I have managed to get the build process working again. The odyssey is hardware-related , so the less said about that, the better.

Now, next question: I’d like to build Krita 5 beta 1. Could some kind soul point me to how to do that? I tried building master, but it has the brush pattern bug that has been discussed elsewhere . I tried selecting the krita/5.0 branch in git, but got a build that shows a black screen when going into full screen mode. What branch is beta 1 built from?

The beta 1 was indeed built from the krita/5.0 branch, however the current tip is quite a few commits ahead now of course.

If you want the exact commit of beta 1, checkout the v5.0.0-beta1 tag.

The pattern bug is still open though, and I just had to report another regression that makes masked brushes malfunction. Unfortunately the meeting had to be skipped again, I just read that halla plans to build beta 2 tomorrow, but I can already tell that it will not resolve all release blockers.


I’m sorry, I was pretty sick, so I couldn’t manage to fix those bugs. The first cold since 2020 really brought me down. I’m still not fit, I’m still feverish, but there are so many fixes since beta1 that I really want to release beta2 this week.


No worries on my account! I’m just looking to do some hacking on Krita and since I’ve been using beta1 without issue for a while now, figured I’d just use that for now, while the kinks get worked out of the newer versions. Got it compiled, too.