Compilation Issue with QWS example
-
I have Qt4.5 Installed on Desktop PC On Ubuntu OS.
While compiling QWS Example i am getting below error -
*
.obj/release-shared/calibration.o: In functionCalibration::accept()': /opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:141: undefined reference to
QWSServer::mouseHandler()'
.obj/release-shared/calibration.o: In functionCalibration::mouseReleaseEvent(QMouseEvent*)': /opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:125: undefined reference to
qt_screen'
.obj/release-shared/calibration.o: In functionCalibration::exec()': /opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:95: undefined reference to
QWSServer::mouseHandler()'
.obj/release-shared/calibration.o: In functionCalibration': /opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:67: undefined reference to
qt_screen'
/opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:67: undefined reference toqt_screen' .obj/release-shared/calibration.o: In function
Calibration::paintEvent(QPaintEvent*)':
/opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:113: undefined reference toqt_screen' .obj/release-shared/main.o: In function
main':
/opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/main.cpp:55: undefined reference toQWSServer::mouseHandler()' collect2: ld returned 1 exit status make[1]: *** [mousecalibration] Error 1 make[1]: Leaving directory
/opt/qtsdk-2010.04/qt/examples/qws/mousecalibration'
make: *** [sub-mousecalibration-make_default] Error 2*Please suggest what i am missing.
Rahul
-
No. QWS is the windowing system provided by Qt for embedded where their is no other windowing system in place. The QWS stuff is only built when configuring for embedded.
Having said that, you can of course build Qt in an embedded configuration but not cross compiled so that it runs on your desktop machine. There are a few ways this can work in practise:
You run the app outside of X so that it draws directly to the Linux framebuffer
You run the app within X but with the qvfb app running. This qvfb app is a virtual framebuffer. This is very useful even when developing for an embedded target system as it allow you to run your app locally.
You run the app but force the display out over vnc. You then of course need a vnc viewer to actually see anything.
It is actually possible to run the app on a framebuffer and vnc at the same time.
Please come back if any of these strikes you as useful for what you are doing.
-
Thanks ZapB..While configuring/building the Qt as embedded i did below step-
./configure -embedded i32 -xplatform linux-g++ -I /usr/lib/glib-2.0/include/*
But i am getting below error while build -
.obj/release-shared-emb-i32/qthread_unix.o: In function
QThreadPrivate::createEventDispatcher(QThreadData*)': qthread_unix.cpp:(.text+0x680): undefined reference to
QEventDispatcherGlib::QEventDispatcherGlib(QObject*)'
qthread_unix.cpp:(.text+0x721): undefined reference toQEventDispatcherGlib::versionSupported()' .obj/release-shared-emb-i32/qcoreapplication.o: In function
QCoreApplicationPrivate::createEventDispatcher()':
qcoreapplication.cpp:(.text+0x1727): undefined reference toQEventDispatcherGlib::QEventDispatcherGlib(QObject*)' qcoreapplication.cpp:(.text+0x1761): undefined reference to
QEventDispatcherGlib::versionSupported()'
.obj/release-shared-emb-i32/qtextcodec.o: In functionsetup()': qtextcodec.cpp:(.text+0x2014): undefined reference to
QIconvCodec::QIconvCodec()'
collect2: ld returned 1 exit status
make[1]: *** [../../lib/libQtCore.so.4.6.3] Error 1
make[1]: Leaving directory `/home/embeddedQt/qtsdk-2010.04/qt/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2On my Desktop glib is already installed..what could be the reason of above?
-
Yes, that is why I said to disable it if it is not available in your cross compiling sysroot. Try passing in -no-glib to your Qt configure line. When trying things like this it also often helps to pass in the -verbose argument so that you can see what tests pass/fail.
If you still can't get it working please paste in the relevant section of the configure process.
-
Hey ZapB I Tried as per your comment and finally able to build. Thanks for your quick support. I gave below command -
./configure -embedded x86 -xplatform linux-g++ -no-glib -no-iconv -qvfb
I am also able to run QWS/framebuffer example outside the X which draws 3 rectangle using qvfb.Which perfact works for me.
But still getting compilation error on mousecalibration example-
/opt/qtsdk-2010.04/qt/examples/qws/mousecalibration/calibration.cpp:141: undefined reference to QWSServer::mouseHandler() -
When you are running qmake on the application .pro file, are you sure that you are running the correct version of qmake. ie the one built as part of your Qt-embedded build?
Where is your Qt-embedded installed to? Can you post the output of:
@which qmake@
and
@qmake -r@
and
Hopefully that will show us which libs the app is trying to link to and whether they are the right ones or not.
I'm offline for periods this week so it may take me a day or more to get back to you.
Good luck!
-
Yes..My embedded Qt is installed on home/embeddedQt/qtsdk-2010.04/qt/
Output of which qmake
/home/embeddedQt/qtsdk-2010.0Reading /home/embeddedQt/qtsdk-2010.04/qt/examplesOutputof qmake -r
/qws/framebuffer/framebuffer.pro
Reading /home/embeddedQt/qtsdk-2010.04/qt/examples/qws/framebuffer/framebuffer.pro
Reading /home/embeddedQt/qtsdk-2010.04/qt/examples/qws/mousecalibration/mousecalibration.pro
Reading /home/embeddedQt/qtsdk-2010.04/qt/examples/qws/simpledecoration/simpledecoration.proOutput of make -
g++ -Wl,-rpath-link,/home/embeddedQt/qtsdk-2010.04/qt/lib -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.6.3-i386/lib -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.6.3-i386/lib -o mousecalibration .obj/release-shared-emb-x86/calibration.o .obj/release-shared-emb-x86/scribblewidget.o .obj/release-shared-emb-x86/main.o -L/home/embeddedQt/qtsdk-2010.04/qt/lib -lQtGui -L/home/embeddedQt/qtsdk-2010.04/qt/lib -lQtNetwork -lQtCore -lpthread
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::accept()': calibration.cpp:(.text+0xb): undefined reference to
QWSServer::mouseHandler()'
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::mouseReleaseEvent(QMouseEvent*)': calibration.cpp:(.text+0x39): undefined reference to
qt_screen'
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::exec()': calibration.cpp:(.text+0xd0): undefined reference to
QWSServer::mouseHandler()'
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::Calibration()': calibration.cpp:(.text+0x283): undefined reference to
qt_screen'
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::Calibration()': calibration.cpp:(.text+0x403): undefined reference to
qt_screen'
.obj/release-shared-emb-x86/calibration.o: In functionCalibration::paintEvent(QPaintEvent*)': calibration.cpp:(.text+0x51f): undefined reference to
qt_screen'
.obj/release-shared-emb-x86/main.o: In functionmain': main.cpp:(.text+0x3d): undefined reference to
QWSServer::mouseHandler()'
collect2: ld returned 1 exit status
make: *** [mousecalibration] Error 1 -
Initially while making setup i downloaded below Qt-4.6.3 version complete SDK and installed it on Desktop
./qt-sdk-linux-x86-opensource-2010.05.1.bin
The Desktop Qt installed path was /opt. Then i took the copy of Desktop Qt qtsdk-2010.04 folder on /home and i configure the Qt as embedded and built it. While build i am giving the path of Qt embedded only.
-
Hi ZapB, Scylla,
I got the solution today..the problem was with my qt embedded installation. I was using the sysroot qt sdk which i got after running the qt-sdk-linux-x86-opensource-2010.05.1.bin.It built fine with default configuration but for embedded configuration (./configure -embedded x86 -xplatform linux-g++ -no-glib -no-iconv -qvfb) it gave me build issue with QWS example.
Then i downloaded the qt for embedded linux version 4.6.2 (qt-everywhere-opensource-src-4.6.2.tar.gz) which works fine for qws.
ZapB thanks alot for your support for finally fixing the issue. .. -
Hi ZapB. I m a beginner in Qt. Is there anyway I can implement and use the QWS on my Desktop Linux system? or Is there any way I can emulate the embedded Linux on the present Linux system.
Also, is there a X Window(client/server) equivalent in Qt?Awaiting your reply.
Thank you. -
Yes you can use qws on your Desttop linux.Download qt-everywhere-opensource-src-4.6.2.tar.gz and gothrough READ.
Configure -
./configure -embedded x86 -xplatform linux-g++
make;make install and run the program using -qws as command line argument from console.
Note- you have to go out from xserver to use qwsGoodLuck-
Rahul Pandey -
Thank you Rahul Pandey. I ll give it a try n get back to u.
Regards,
Vijaeendra Simha