I don't know what specifically is the problem, but I strongly suspect that it's something with using g++ directly instead of running stuff through qmake.