If you include the QtWidgets file in .cpp, then when checking the syntax of clang (clang_complete, vim), an error is noted, during the transition we will go to the qglobal.h file where it says:
#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \ (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500)) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ "Compile your code with -fPIC (-fPIE is not enough)." #endif What does this mean and why does clang see an error at this moment?
#iftrue, then the#errordirective, which the developers have placed in this .h file, is triggered. Probably you should follow their recommendations"Compile your code with -fPIC (-fPIE is not enough)."- avp