QT_NO_THREAD
-
Hi,
I'm trying to get a non-threaded version of Qt working, but I seem to be having trouble compiling it. When I disable threading support with the QT_NO_THREAD flag, I get compile errors:
@
In file included from ../../include/QtCore/private/qthread_p.h:1:0,
from global/qglobal.cpp:52:
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h: In constructor ‘QThreadPrivate::QThreadPrivate(QThreadData*)’:
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h:172:59: error: invalid use of incomplete type ‘struct QThreadData’
../../include/QtCore/../../src/corelib/kernel/qobject.h:306:18: error: forward declaration of ‘struct QThreadData’
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h: In destructor ‘virtual QThreadPrivate::~QThreadPrivate()’:
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h:173:32: warning: possible problem detected in invocation of delete operator:
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h:173:32: warning: invalid use of incomplete type ‘struct QThreadData’
../../include/QtCore/../../src/corelib/kernel/qobject.h:306:18: warning: forward declaration of ‘struct QThreadData’
../../include/QtCore/private/../../../src/corelib/thread/qthread_p.h:173:32: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
make[1]: *** [.obj/debug-shared-emb-generic/qglobal.o] Error 1
make[1]: Leaving directory `/home/****/qt-everywhere-opensource-src-4.7.0/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2
@I'm working of Qt for Embedded Linux 4.7.0. This is on Ubuntu 11.04.
Thanks.
-
I didn't know it was still possible i saw this on it in google maybe it will help http://doc.qt.nokia.com/main-snapshot/fine-tuning-features.html
-
[quote author="Volker" date="1313619534"]That flag is for building Qt.
If you want to strip threading support, you will have to rebuild your Qt libraries. You can not strip it by just defining QT_NO_THREAD.[/quote]
This is what I'm doing. I'm building Qt for Embedded Linux 4.7.0. When I try to disable threading support while building the Qt libraries (by defining the QT_NO_THREAD flag), I get this error.
-
[quote author="Volker" date="1313620932"]src/corelib/global/qfeatures.txt does not list QT_NO_THREAD as a supported define. I would guess, this is a remainder of the old Qt 3 days, where threading was optional. It could well be that threading is no longer optional but required in Qt 4.[/quote]
This is definitely a possibility, but I'd like to think otherwise. However, src/tools/bootstrap also QT_NO_THREAD as one of its defines. I've looked at the source code, and I reformatted it to get rid of the compiler errors, but now I've come across other compiler errors, so i was wondering if QT_NO_THREAD was really supported.
-
In Qt 3 there used to be a switch to turn off threading support in Qt. This has gone in Qt 4.
bootstrap is a different beast, it is used to build Qt libs (i.e. to make a static (in the sense of no dynamic linking to Qt libs) version of qmake etc.).
I'm sorry, but I'm pretty sure that Qt 4 cannot be built without thread support. It is used all throughout QCoreApplication for example.
-
[quote author="Volker" date="1313665046"]In Qt 3 there used to be a switch to turn off threading support in Qt. This has gone in Qt 4.
bootstrap is a different beast, it is used to build Qt libs (i.e. to make a static (in the sense of no dynamic linking to Qt libs) version of qmake etc.).
I'm sorry, but I'm pretty sure that Qt 4 cannot be built without thread support. It is used all throughout QCoreApplication for example.[/quote]
Okay. Thanks for your help.