Qt can use any compiler installed on the system.
Im usually using msvc with it.

Anyways, this error usually pops up when you use a class variable name which is preserved by the compiler.
You should really drop g++ and simply use msvc, clang or intels compiler