Compiling QtCreator 3.4.2 with Qt 5.5.0 reports error on qsingleapplication.h: using of incomplete class "QSharedMemory"
-
Hello everyone !
I'm compiling QtCreator v3.4.2 with Qt v5.5.0. The compiler I used is MinGW-w64 4.9.2 in MSYS2. But while compiling the cpp files who includes fileqsingleapplication.hat path<QtCreator_Src_Dir>/src/shared/qtsingleapplication, the compiler report errors such asusing of incomplete class 'QSharedMemory' ...blablabla.I'm also tried to compile this version of QtCreator with Qt v5.4.2, and using the same compiler. The compiling error didn't appear. So I think maybe there is something wrong with Qt v5.5.0? But there are too many difference between the source code of Qt5.4.2 and Qt5.5.0, and I can't find the code which caused error. Could anyone help? Thx!
-
Newest progress:
Today after many times of compiling and testing, I found this error was caused by the definition of macroQT_NO_SHAREDMEMORY, it made the definition of classQSharedMemoryunavailable in header file<QT_INSTALL_DIR>/include/QtCore/qsharedmemory.h.
The macroQT_NO_SHAREDMEMORYis defined in qconfig.h, which is generated in my custom-building progress of Qt5.5.0. But theqconfig.hin official version of Qt5.5.0 does not contains the definition of that macro. So I guess whether the configure scripts generated this macro, becauseqconfig.his generated by the scripts in file<QT_SRC_DIR>/qtbase/configure.
After many times of testing, I found there is a part of script code which is very strange and make me confused. this part of script lies in line 4453 - 4463:# check IPC support if ! compileTest unix/ipc_sysv "ipc_sysv" ; then # SYSV IPC is not supported - check POSIX IPC if compileTest unix/ipc_posix "ipc_posix" ; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_POSIX_IPC" else if [ "$XPLATFORM_ANDROID" = "no" ] ; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SYSTEMSEMAPHORE QT_NO_SHAREDMEMORY" fi fi fiAs mentioned above, if the script found the compileTest of
ipc_posixfailed, and if the target platform is notandroid, then variableQCONFIG_FLAGSwill be appended withQT_NO_SYSTEMSEMAPHOREandQT_NO_SHAREDMEMORY. Therefore the scripts between line6662and6693will generate the definition of macroQT_NO_SHAREDMEMORYin fileqconfig.h.I'm doubted that why the
SYSTEMSEMAPHOREandSHAREDMEMORYshould be disabled while the target platform is notandroid. I guess maybe it is a clerical error and the codeif [ "$XPLATFORM_ANDROID" = "no" ] ;should beif [ "$XPLATFORM_ANDROID" != "no" ] ;. But I'm not sure, could any one tell me?