Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] Problem with QtEmbedded configuration
Hi Every body
i have installed Qt 5.2.1 and tried to configure Qt libraries 4.8.5 for embedded Linux many times but at the end still no sign of success.
I have followed the instruction in this link
appreciate for your helps in advance.
Hi and welcome to devnet,
What errors are you getting ?
many thanks for your response.
look what i get:
i made a hello.cpp file in a directory called hello and applied the following commands.
int main(int argc, char*argv)
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
hoss@hoss-ubuntu:~/Desktop/hello$ qmake -project
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5.2.1/5.2.1/gcc/mkspecs/linux-g++ -I. -I. -I/opt/Qt5.2.1/5.2.1/gcc/include -I/opt/Qt5.2.1/5.2.1/gcc/include/QtGui -I/opt/Qt5.2.1/5.2.1/gcc/include/QtCore -I. -o hello.o hello.cpp
hello.cpp:1:24: fatal error: QApplication: No such file or directory
make: *** [hello.o] Error 1
[Edit: Added @ tags around literal code -- mlong]
That won't work for several reasons:
- You want to create an embedded application with Qt 4.8.5 and you are calling the Qt 5.2.1 qmake
- In Qt 5, QApplication and QLabel are in the widgets module so you have to add it in your pro file (Qt Creator would have done it for you since in knows before hand that you will use widgets, qmake can't)
So first thing is to ensure that you use the correct qmake.
On a side note (but this is more a clean coder hint not a mandatory thing) your main function should reside in main.cpp. This is the common pattern and where most people will look for it.
thanks for your advise.
so what version of embedded libraries should I use for Qt5.2.1?
or should I use other version of Qt with Qt4.8.5 embedded libraries.
That depends on your project. Since you are talking about Qt Embedded, it's Qt 4. If you have already built it, then just use the qmake that you got when building it to handle your Qt Embedded project.
Many thanks for your kind responses.
I have done all the steps and still dont get the result.
Can i ask you to do me a favour and give me the steps i should go through to get me running?
I have files : qt-opensource-linux-x86-5.2.1.run , qt-everywhere-opensource-src-4.8.5.tar already downloaded.
I need to configure the Qt for Arm linux .
You have "here":http://qt-project.org/doc/qt-4.8/qt-embedded-install.html the instruction for Qt 4
i finally made the configuration:
hoss@hoss-ubuntu:~/Desktop/helloworld$ qmake -project
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -Wl,-O1 -o helloworld main.o -L/usr/lib/i386-linux-gnu -lQtGui -lQtCore -lpthread
but the file doesnt seems to be in ARM format!!!!!!!
hoss@hoss-ubuntu:~/Desktop/helloworld$ file helloworld
helloworld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xdef577a6fa28b9f101ef506c6a726980b91f86d4, not stripped
it seems something wrong with my configuration . i used the following :
./configure -prefix /qtebuild/ -release -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -nomake examples -nomake demos -nomake tools -optimized-qmake -no-phonon -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -no-qvfb -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb-qt-kbd-usb -confirm-license -qt-mouse-tslib
please advise me a bit more
Because you are not using the right qmake, use the full path to the qmake from your cross-compiled Qt.
Probably something like /usr/local/Trolltech/QtEmbedded-4.8.5/bin/qmake
I have installed Qt and now start programming.
I wrote a program to draw graph by QwtPlot.
so I dropped to QwtPlot widget on the form and separated them by vertical spacer, as I need to separate grid of different sizes to draw different curve.
I introduced some points to be drawn and it looks ok when the x and y axis are enabled.
but I like to disable the x and y axis and that makes the height of plot according to the highest y value and keeps changing as I change the points.
how can I keep the grid and plotting area of each widget constant?
McLion last edited by
If you original problem discussed in this thread has been solved, please mark this thread as Solved in the title and open a new thread for a new topic.
This helps others finding solutions to their issues.