Solved QString Error
-
@marvic_39
Are you doing this inside the structure? QString settingsFile("Hello");
Is the error at line 108 bec of this ? -
I cleaned all GCC versions and activated 4.7
Now it's compiled and executed my app.QString settingsFile{"neet/One.json"};
Very strange about the brackets () and {}
Thank You guys, it's GCC 4.7 made the difference.
-
@marvic_39
Once your problem is solved please use the Topic Tools button to mark as Solved.
Thank you! -
Ok. I think I get what your problem was. In all probability C++11 is enabled by default in GCC 4.7 (on your distribution), that is why I asked what compiler and environment you're using. Here is the relevant link:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
That being said, without the non-static data member initializers supported by the compiler you are obliged to initialize the object in your class' constructor and cannot do it in its declaration. Meaning that if you compile the code on another platform and/or compiler that does not have the C++11 standard enabled you'll get similar errors.