How to run QT application on X-window of the embedded platform
-
qt-everywhere-opensource-src-x.y.z/mkspecs directory used for (cross) compiling Qt for various targets.
qt-everywhere-opensource-src-x.y.z/mkspecs/qws directory used for (cross) compiling Qt embedded for various targets.So, I checked "mkspecs directory":http://qt.gitorious.org/qt/qt/trees/4.8/mkspecs and found a mistake.
bq. I’m not sure, but I think it will be correct: “./configure -platform arm-none-linux-gnueabi-g++”.
Correct is: "./configure -platform linux-arm-gnueabi-g++".
-
Correct is: “./configure -platform linux-arm-gnueabi-g++”.
But in /mkspecs directory, there is no folder of "linux-arm-gnueabi-g++",and my qt opensource's version is 4.8.1. So I just copied /mkspecs/qws/linux-arm-gnueabi-g++ to /mkspecs. I think what I did is not true, but I dont know how to get linux-arm-gnueabi-g++ in /mkspecs.
-
About second question.
Your qt test program was built on arm system as a native program? Can you show ldd output?bq. But in /mkspecs directory, there is no folder of “linux-arm-gnueabi-g++”,and my qt opensource’s version is 4.8.1. So I just copied /mkspecs/qws/linux-arm-gnueabi-g++ to /mkspecs. I think what I did is not true, but I dont know how to get linux-arm-gnueabi-g++ in /mkspecs.
Copy it from qt.gitorious, Are you checked the link "mkspecs directory":http://qt.gitorious.org/qt/qt/trees/4.8/mkspecs ?
-
My cross compiler is arm-none-linux-gnueabi-g++ not linux-arm-gnueabi-g++.
I copy the folder of linux-arm-gnueabi-g++ from qt.gitorious to /mkspecs, and I replace "linux-arm-gnueabi-g++" for "arm-none-linux-gnueabi-g++ ". Then I configure "./configure -platform linux-arm-gnueabi-g++",there is two errors:
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/bin/qmake: 1: Syntax error: word unexpected (expecting ")")
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/mkspecs/linux-arm-gnueabi-g++.But if I configure "./configure -xplatform linux-arm-gnueabi-g++" after clean configure, there just an error:
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/mkspecs/linux-arm-gnueabi-g++. -
So, there are two ways:
- Write your own mkspec for arm-none-linux-gnueabi-g++ compiler (or find in google). Then ./configure -arch arm -xplatform arm-none-linux-gnueabi-g++;
- "sudo apt-get install g++-arm-linux-gnueabi" and try to use mkspec from qt.gitorius. Then ./configure -arch arm -xplatform linux-arm-gnueabi-g++.
bq. Basic XLib functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11
You need to specify X11 include files and libraries, arm libs!
-
You need to specify X11 include files and libraries, arm libs!
================================
I have specified X11 include files and libraries(for arm)' path by modifing linux.conf in /mkspecs/common, but the error remain. Is it right?
It is too later tonight, I will compile QT-lib following what you said tomorrow.
Anyway, thank you help me again and again. -
bq. I have specified X11 include files and libraries(for arm)’ path by modifing linux.conf in /mkspecs/common, but the error remain. Is it right?
I'm think it's right.
This error can be when libXext is missed.
Here is "Qt for X11 requirements":http://qt-project.org/doc/qt-4.8/requirements-x11.html. Ensure that you have all required libs. -
One more question, when I configure my QT-lib compiling using "./configure -xplatform linux-arm-gnueabi-g++",
it outputs "You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependencies"
But when I use "./configure", there is no that message.Although it is not en error, I think something is not configured right.
-
After I modified "QMAKE_LIBS_X11 = -lXext -lX11 -lm -lxcb -lpthread-stubs -lXau -lXdmcp " in /mkspecs/common/linux.conf,
now I can configure successfully by using "./configure -arch arm -xplatform linux-arm-gnueabi-g++ -force-pkg-config".However, after I "make", there are some errors:
arm-none-linux-gnueabi-g++ -Wl,-rpath-link,/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.1/lib -o rsslisting .obj/release-shared/main.o .obj/release-shared/rsslisting.o .obj/release-shared/moc_rsslisting.o -L/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -lQtXml -L/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -lQtGui -L/opt/ezsdk_5_03_01_15/linux-devkit/arm-none-linux-gnueabi/usr/lib -lQtNetwork -lQtCore -lpthread
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libXrender.so.1, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libXext.so.6, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libX11.so.6, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libxcb.so.1, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libpthread-stubs.so.0, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libXau.so.6, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libXdmcp.so.6, needed by /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetTile' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XReparentWindow'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetIMValues' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XConvertSelection'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetFillStyle' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XUnsetICFocus'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to `XQueryColors' -
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XTranslateCoordinates' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XDeleteProperty'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetWMColormapWindows' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XVisualIDFromVisual'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetICFocus' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XMaxRequestSize'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetErrorDatabaseText' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XUngrabButton'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXOpenIM' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetInputFocus'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXCheckTypedEvent' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XDefineCursor'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetFunction' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XKillClient'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXRenderCreatePicture' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XVaCreateNestedList'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetFontPath' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XShapeCombineRegion'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSetClipRectangles' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetWindowAttributes'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXRemoveFromSaveSet' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGrabButton'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetKeyboardMapping' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XFreePixmap'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXLoadQueryFont' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XFillPolygon'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXUnionRectWithRegion' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XSyncDestroyCounter'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXmbTextPropertyToTextList' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XRenderCreateCursor'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetSelectionOwner' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XCloseDisplay'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSync' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetAtomName'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXCheckIfEvent' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XPutImage'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXDrawString16' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XListPixmapFormats'
collect2: ld returned 1 exit status
make[3]: *** [rsslisting] Error 1
make[3]: Leaving directory/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples/xml/rsslisting' make[2]: *** [sub-rsslisting-make_default] Error 2 make[2]: Leaving directory
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples/xml'
make[1]: *** [sub-xml-make_default] Error 2
make[1]: Leaving directory `/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples'
make: *** [sub-examples-make_default-ordered] Error 2Can you tell me how to eliminate these error?
-
When I make again by configuring " ./configure -arch arm -xplatform arm-none-linux-gnueabi-g++ -release -force-pkg-config"
There is an other error:arm-none-linux-gnueabi-g++ -Wl,-rpath-link,/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -Wl,-O1 -Wl,-rpath,/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/src/3rdparty/webkit/Source/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.1/lib -o tst_qdeclarativewebview .obj/release-shared/tst_qdeclarativewebview.o .obj/release-shared/qrc_tst_qdeclarativewebview.o -L/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -L/opt/ezsdk_5_03_01_15/linux-devkit/arm-none-linux-gnueabi/usr/lib -L/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib -lQtDeclarative -lQtScript -lQtSvg -L/opt/ezsdk_5_03_01_15/linux-devkit/arm-none-linux-gnueabi/usr/lib -lQtSql -lQtXmlPatterns -lQtWebKit -lQtTest -lQtGui -lQtNetwork -lQtCore -lpthread -lXrender -lXext -lX11 -lm -lxcb -lpthread-stubs -lXau -lXdmcp
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtCore.so: undefined reference toQInotifyFileSystemWatcherEngine::create()' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtCore.so: undefined reference to
clock_gettime'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtCore.so: undefined reference toQDnotifyFileSystemWatcherEngine::create()' collect2: ld returned 1 exit status make[3]: *** [tst_qdeclarativewebview] Error 1 make[3]: Leaving directory
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/src/3rdparty/webkit/Source/WebKit/qt/tests/qdeclarativewebview'
make[2]: *** [sub-qdeclarativewebview-make_default] Error 2there are many more "undefined reference to" variables, why?
-
Are you sure that path to arm X11 libraries is correct (in linux.conf QMAKE_LIBDIR_X11 and QMAKE_INCDIR_X11) and X11 version is X11R6? If it's true, then i can suppose that arm-none-linux-gnueabi-g++ and linux-arm-gnueabi-g++ have a different binary format and ld can't link it. If i'm right, you should use one compiler for X11 libs and Qt. It means that you should use linux-arm-gnueabi-g++ rather than arm-none-linux-gnueabi-g++, because it's compiler from Ubuntu repository and you are compiling for Ubuntu.
But I didn't have any problems like this. So, I don't know what exactly you should do in this case :(
-
- “sudo apt-get install g++-arm-linux-gnueabi” and try to use mkspec from qt.gitorius. Then ./configure -arch arm -xplatform linux-arm-gnueabi-g++.
===============================================
Today I followed the second method to apt-get install g++-arm-linux-gnueabi and make my QT-lib,and those errors still exist./home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XDefineCursor' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XSetFunction'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXKillClient' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XRenderCreatePicture'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXVaCreateNestedList' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetFontPath'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXShapeCombineRegion' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XSetClipRectangles'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toSmcOpenConnection' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetWindowAttributes'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXRemoveFromSaveSet' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGrabButton'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetKeyboardMapping' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XFreePixmap'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXLoadQueryFont' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XFillPolygon'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toSmcSaveYourselfDone' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XUnionRectWithRegion'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXSyncDestroyCounter' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XmbTextPropertyToTextList'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXRenderCreateCursor' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XGetSelectionOwner'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXCloseDisplay' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XSync'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXGetAtomName' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XCheckIfEvent'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXPutImage' /home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference to
XDrawString16'
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/lib/libQtGui.so: undefined reference toXListPixmapFormats' collect2: ld returned 1 exit status make[3]: *** [saxbookmarks] Error 1 make[3]: Leaving directory
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples/xml/saxbookmarks'
make[2]: *** [sub-saxbookmarks-make_default] Error 2
make[2]: Leaving directory/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples/xml' make[1]: *** [sub-xml-make_default] Error 2 make[1]: Leaving directory
/home/xushaofan/qt_4.8.1_pkg/qt-everywhere-opensource-src-4.8.1/examples'
make: *** [sub-examples-make_default-ordered] Error 2==============================
And I am sure my arm X11 libraries is correct. Because in /qt-everywhere-opensource-src-4.8.1/config.tests/x11/xlib, I use "arm-linux-gnueabi-g++ -o xlib xlib.cpp -I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include -L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib -lXext -lX11 -lm -lxcb -lpthread-stubs -lXau -lXdmcp"
and "arm-none-linux-gnueabi-g++ -o xlib xlib.cpp -I/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/include -L/opt/ezsdk/linux-devkit/arm-none-linux-gnueabi/usr/lib -lXext -lX11 -lm -lxcb -lpthread-stubs -lXau -lXdmcp"
to compile xlib. Both successfully.Bye the way, the X11 libraries' directory is under the /arm-none-linux-gnueabi/usr/lib in filesystem, so I think the X11 libraries is compiled by arm-none-linux-gnueabi. However, Whether I use "arm-none-linux-gnueabi-g++" or "linux-arm-gnueabi-g++" to make my QT-lib, those “ undefined reference to” error still exist.
-
[quote author="Serg" date="1337702523"]Are you sure that path to arm X11 libraries is correct (in linux.conf QMAKE_LIBDIR_X11 and QMAKE_INCDIR_X11) and X11 version is X11R6? If it's true, then i can suppose that arm-none-linux-gnueabi-g++ and linux-arm-gnueabi-g++ have a different binary format and ld can't link it. If i'm right, you should use one compiler for X11 libs and Qt. It means that you should use linux-arm-gnueabi-g++ rather than arm-none-linux-gnueabi-g++, because it's compiler from Ubuntu repository and you are compiling for Ubuntu.
But I didn't have any problems like this. So, I don't know what exactly you should do in this case :([/quote]
Sorry for reply later. Last Thursday, I had copiled QT-LIB for Ubuntu based DM8148 successfully.
Above these errors, I made two mistakes about X11-LIB.
- I wrote my own mkspec for arm-none-linux-gnueabi-g++ compiler, and I named it "arm-none-linux-gnueabi-g++" not "linux-", so when I make, there is an error: /lib/libQtCore.so: undefined reference to `QDnotifyFileSystemWatcherEngine::create()’
Because When creating the mkspec for a embedded target if the name of the directory does not match "linux-*" then the following build error will be seen.
The resolution is :
edit ./src/corelib/io/io.pri
find linux-*:
append your cross-toolchain's prefix after iteg:
my toolchains's prefix is arm_xxxxx
so....
68 linux-|arm:{
69 SOURCES +=
70 io/qfilesystemwatcher_inotify.cpp
71 io/qfilesystemwatcher_dnotify.cpp
72
73 HEADERS +=
74 io/qfilesystemwatcher_inotify_p.h
75 io/qfilesystemwatcher_dnotify_p.h
76 }==================================================================
- /lib/libQtCore.so: undefined reference to `clock_gettime’:
append "-lrt" parameters after the "./configure" so that the compiler can find the define in librt.
==================================================================
- “/lib/libQtGui.so: undefined reference to” about X11-lib
I modified QMAKE_LIBDIR_X11, QMAKE_INCDIR_X11 and QMAKE_LIBS_X11 in /mkspec/common/linux.conf to specify X11 include files and libraries, arm libs. However the Makefile, which qmake generated, did not include X11-LIB in the “LIBS”. So when I compile the demos or examples of QT, there are many of "undefined reference to" errors about X11-LIB, then I append "-lXmu -lXft -lXt -lXcursor -lXrandr -lXrender -lXv -lXdamage -lXcomposite -lxcb-damage -lxcb-composite -lxcb-randr -lxcb-xv -lxcb-xvmc -lxcb-xprint -lxcb-xtest -lxcb-xfixes -lxcb-xinerama -lxcb-xevie -lxcb-xf86dri -lxcb-shape -lxcb-shm -lxcb-sync -lxcb-render -lxcb-res -lxcb-screensaver -lxcb-dpms -lxcb-dri2 -lxcb-record -lxcb-glx -lXfixes -lXext -lX11-xcb -lX11 -lxcb -lXau -lXdmcp -lfontconfig -lfreetype -lpthread-stubs -lexpat -lm -lz -lstdc++ -lglib-2.0 -lSM -lICE -luuid " after "LIBS =" in demos and examples' Makefiles which qmake generated, and it can compile successfully.
But I have not find why my qmake not generate above of X11-LIB in Makefile. I am sure that "linux.conf" is modified correctly.
==============================================
Anyway, I have transplanted QT-LIB to Ubuntu successfully, and I must thank you so much for your warm-heart and help me again and aigan!!! If there were no your guidance, I wound not complete it.
- I wrote my own mkspec for arm-none-linux-gnueabi-g++ compiler, and I named it "arm-none-linux-gnueabi-g++" not "linux-", so when I make, there is an error: /lib/libQtCore.so: undefined reference to `QDnotifyFileSystemWatcherEngine::create()’
-
My test-program works fine, besides two small questions:
-
My .gif files dont display, while I am sure I have compiled libqgif.so in plugins/mageformats, and have put it in qt-lib directory of filesystem.
-
My test-program can generate ico which I selected in Windows platform, but can not generate in Ubuntu platform。 libqico.so has been also in plugins/mageformats.
-
-
i tried to compile the QT with following command by following
“http://forums.digi.com/support/forum/viewthread_thread,6858#20693”./configure -confirm-license -embedded arm -xplatform qws/linux-arm-g++ -prefix /usr/local/QtEmbedded-4.4.3 -hostprefix /usr/local/DigiEL-5.6/x-tools/arm-cortex_a8-linux-gnueabi -qt-sql-sqlite -depths 15,16 -qt-kbd-usb -qt-mouse-tslib
and i got this error
Basic XLib functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/qmax/Desktop/QT_Latest/qt-x11-opensource-src-4.5.3/mkspecs/qws/linux-arm-g++.
I tried the following
Try 1:sudo apt-get build-dep qt4-qmake (installed)
Ref:http://www.qtforum.org/article/27401/debian-xlib-test-failed-after-configure.html
Try 2:
sudo apt-get build-dep libxext-dev
Try 3:
sudo apt-get install libx11-dev libxau-dev libxaw7-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev sudo apt-get install libxext-dev libxfixes-dev libxfont-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev sudo apt-get install libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev sudo apt-get install libglib2.0-dev sudo apt-get install libssl-dev sudo apt-get install libgtk2.0-dev sudo apt-get install libcups2-dev sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev sudo apt-get install libgstreamer0.10-dev
Ref:http://qt-project.org/wiki/Compile_Qt_4.7_on_Ubuntu_10.10
Try 4:
sudo apt-get install ^libxcb.* libx11-xcb-dev libglu1-mesa-dev libxrender-dev -y
Ref:http://qt-project.org/forums/viewthread/15858
But nothing works…still same error…..
did anyone got the solution
-
Hello Everyone , I am also facing a similar problem.
I have a BeagleBone Black (Rev A 5c) running Angstrom linux.
I have ubuntu 13.04 PC as host. I am trying to run a Qt UI application on Beaglebone which is connected to HDMI screen on which by default it shows Desktop Screen.
First of All , I set up Qt -(4.8.5 )build environment for ARM on my ubuntu (Host).
Then I transfered The Qt library to Beaglebone.
I am able to cross compile applications for Beaglebone on Qtcreator .
I tranfered the executable file to BeagleBone ,The console/terminal applications are running fine but when i Start the GUI application ,No window frame launches up inside the desktop as if app. do not start . I can just see desktop.I followed this tutorial to set up Qt-4.8.5(http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone).
Someone PLease help.Your help will be appreciated.