How to fix an error pointed to QtCore/qvector.h
-
Hi,
Using Qt 5.14.2 and RHEL 7.9 VM and got the error message below and it pointed to in the header file qvector.h in QCore.
(/opt/Qt5.14.2/5.14.2/gcc_64/include/QtCore/qvector.h)Invalid initialization of non-const reference of type 'Text&'
from an rvalue of type 'std::remove_refence<Text&>::type {aka Text}'Appreciate any help!
-
Also make sure you use a recent gcc - what gcc version do you use? Please also see this page - supported platforms.
-
Sorry for late responses!
I'm using gcc version 5.3.1 from devtoolset-4 as directed from the support platform page.
The tricky & strange part is that it does not mention anything to my source code, but it just simply points to qvector.h in QtCore. How I know which part of my code has pawned this bug as QVector has been used everywhere in my program. For more info, please look at the screen shot from the output pane below. -
And make sure that really gcc5 is used. I would guess it's not the case. This can also be seen in the compiler output
-
This post is deleted!