build error in kdelibs - QTest related

Ingo Klöcker kloecker at
Mon Dec 7 22:08:28 GMT 2009

On Monday 07 December 2009, Alexander Neundorf wrote:
> Hi,
> kdelibs currently does not build on Solaris with the Sun Studio
> compiler if the tests are enabled:
> This is the error:
> [ 31%] Building CXX object
> kdecore/tests/CMakeFiles/kjobtest.dir/kjobtest.o
> "/.../srcdir/kdecore/tests/kjobtest.cpp", line 96: Error: Could not
> find a match for QTest::qCompare<QTest::T>(KJob*, TestJob*, const
> char[45], const char[4], const char[65], int) needed in
> KJobTest::testProgressTracking().
> Any idea what's wrong here ?

Excerpt of
QCOMPARE is very strict on the data types. Both actual and expected have 
to be of the same type, otherwise the test won't compile. This 
prohibits unspecified behavior from being introduced; that is behavior 
that usually occurs when the compiler implicitly casts the argument.

Apparently, the Sun Studio compiler is stricter than gcc and does not 
cast TestJob* to KJob*, but regards them as different (which they are).

QCOMPARE( 0 ).at( 0 ).value<KJob*>(), job );
QCOMPARE( 0 ).at( 0 ).value<KJob*>(), 
static_cast<KJob*>( job ) );
should help.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list