Can't find QElapsedTimer in VS2015
I made a project in VS 2015 with Qt 5.8. I can use QTimer, but I can't use QElapsedTimer.
I have another project that can use QTimer and QElapsedTimer. I can't figure out the difference.
When it works I can see QElapsedTimer in Additional Dependencies. When it doesn't, I cannot.
Both QTimer and QElapsedTimer are located in the Qt\Core directory.
Is there a prepoccessor or project setting I am missing?
Re: Can't find QElapsedTimer in VS2015
Quote:
I can't use QElapsedTimer
What do you mean, you can't "use" it? Do you get a compiler error, a linker error, or does the code not run in the way you expect it to run?
Probably you will need to post the code where you are trying to "use" it.
Re: Can't find QElapsedTimer in VS2015
If I put this code below it changes color and I can find the definition for it.
If I try this code below it never changes color and I can't find the definition.
Code:
QElapsedTimer *blah;
If I try to compile I get an undeclared identifier error.
In my other project they both work and it compiles.
Re: Can't find QElapsedTimer in VS2015
Quote:
I get an undeclared identifier error.
And do you have a
Code:
#include <QElapsedTimer>
statement at the top of your .cpp file? And maybe a forward declaration
Code:
class QElapsedTimer;
in your .h file somewhere before you declare this variable?