QT_NO_THREAD
-
wrote on 17 Aug 2011, 01:40 last edited by
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.
-
wrote on 17 Aug 2011, 04:17 last edited by
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
-
wrote on 17 Aug 2011, 19:09 last edited by
Yes, actually that's where I got the idea of using the QT_NO_THREAD flag.
-
wrote on 17 Aug 2011, 22:18 last edited by
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.
-
wrote on 17 Aug 2011, 22:24 last edited by
[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.
-
wrote on 17 Aug 2011, 22:42 last edited by
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.
-
wrote on 17 Aug 2011, 23:00 last edited by
[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.
-
wrote on 18 Aug 2011, 10:57 last edited by
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.
-
wrote on 19 Aug 2011, 19:17 last edited by
[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.
7/9