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.h
at 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 classQSharedMemory
unavailable in header file<QT_INSTALL_DIR>/include/QtCore/qsharedmemory.h
.
The macroQT_NO_SHAREDMEMORY
is defined in qconfig.h, which is generated in my custom-building progress of Qt5.5.0. But theqconfig.h
in 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.h
is 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 fi
As mentioned above, if the script found the compileTest of
ipc_posix
failed, and if the target platform is notandroid
, then variableQCONFIG_FLAGS
will be appended withQT_NO_SYSTEMSEMAPHORE
andQT_NO_SHAREDMEMORY
. Therefore the scripts between line6662
and6693
will generate the definition of macroQT_NO_SHAREDMEMORY
in fileqconfig.h
.I'm doubted that why the
SYSTEMSEMAPHORE
andSHAREDMEMORY
should 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?