Search code examples
qtuint

uint was not declared in this scope


I'm trying to setup a Google test in Qt and I am having multiple problems, the most annoying of which is "uint was not declared in this scope". This was compiling until recently but now it has decided it cannot find it.


Solution

  • There are two things to note in here:

    1) You could use the Qt types, namely: quint8/16/32/64, depending on range you need.

    2) More importantly, you pasted a uint loop counter in comments. For that, you should not even use unsigned int, but size_t.

    for (size_t i; i < x.cols; ++i);