Error message in object pointer definition. Don't know what means.
Good day!
What means the following error message and how can i fix it? I'm using QtCreator-5.3.2 with GCC-4.6.1 64bit.
Quote:
warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
Error pointing to this code line:
Code:
{
//...
public:
Historic *hs = NULL; Message error here.
Thanks!
Re: Error message in object pointer definition. Don't know what means.
You should use initializer lists for member parameter initialization:
Code:
class Data
: public QDialog, hs
(NULL) {
//...
public:
Historic *hs;
Edit: And yes, you should also add c++11 to your CONFIG statement in your *.pro file too to enable the c++11 standard for many different reasons.
Re: Error message in object pointer definition. Don't know what means.
To use this feature you need to enable C++11.
Code:
CONFIG += c++11
or
QMAKE_CXXFLAGS += -std=c++11
in your .pro file.
Other way: set pointer in constructor.