Always use the same compiler that was used to compile Qt. OTherwise you get lots of linker and compile errors, this due to namemangling issues between linkers.
The C++ standard doesn't say to compile and link, only how to code and what should happen if uses.