Search code examples
qtqstring

I get error in Qt: SIGILL ERROR


I'm gettint error when trying to compare a QString with a empty string.

QString S = "abc";
if (S != "") // Sigill on this line
{
qDebug("ok");
}

Solution

  • According to the signal man page (section 7), SIGILL indicates an illegal instruction and is raised if an attempt is made to execute an instruction that is invalid or ill-formed or if the instruction requires a higher privilege level than you run at.

    Because the comparison of two strings should not require operations that need special privileges, your QT version was likely compiled with supoort for instruction sets that are not supported by your processor (eg. support for SSE 4.2, whereas your processor does not support SSE 4.2). To check that condition, you might recompile the QT library after checking that all instruction sets the compiler uses are supported by your processor.