native build qt5.7.1 on raspberry pi get errors: /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to `QV8Engine::toVariant



  • I tried to build qt 5.7.1 on pi3 following this instruction:
    https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi

    the source package i use is: qt-everywhere-opensource-src-5.7.1.tar

    configure as:

    ./configure -v -opengl es2 -force-pkg-config -device linux-rpi3-g++ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -qt-xcb -make libs -no-use-gold-linker -prefix /usr/local/qt5

    The instruction is using "linux-rasp-pi-g++", but i think it should be linux-rpi3-g++ for Rpi3.

    Make, and i get errors like:

    /usr/bin/g++ -Wl,-rpath-link,/opt/vc/lib -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,--gc-sections -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../lib -Wl,-rpath-link,/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib -Wl,-rpath-link,/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib -o ../../bin/qmltestrunner .obj/main.o -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib -lQt5QuickTest -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Test -lQt5Core -lGLESv2 -lpthread /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV8Engine::toVariant(QV4::ValueRef, int)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlProfilerService::dataReady(QQmlAbstractProfilerAdapter*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::ExecutionContext::throwTypeError()'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::markObjects(QV4::Managed*, QV4::ExecutionEngine*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlEngineDebugService::instance()'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV8Engine::fromVariant(QVariant const&)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::PersistentValue::operator=(unsigned long long)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlValueType::qt_metacast(char const*)' /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickItem::y() const@Qt_5'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::errors() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Managed::engine() const'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::ExecutionEngine::newErrorObject(QV4::ValueRef)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlBinding::property() const'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlCustomParser::bindingIdentifier(QV4::CompiledData::Binding const*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::ExecutionContext::throwError(QString const&)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlBinding::Invalid' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlAbstractBinding::vTables'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::ExecutionContext::throwError(QV4::ValueRef)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::call(QV4::Managed*, QV4::CallData*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlBinding::createBinding(int, QObject*, QQmlContext*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Managed::operator new(unsigned int, QV4::MemoryManager*)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::height() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::setLookup(QV4::Managed*, QV4::Lookup*, QV4::ValueRef)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::PersistentValue::PersistentValue(QV4::ValueRef)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlValueType::qt_metacall(QMetaObject::Call, int, void**)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlProfilerService::addGlobalProfiler(QQmlAbstractProfilerAdapter*)' /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickView::QQuickView(QWindow*)@Qt_5'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::putIndexed(QV4::Managed*, unsigned int, QV4::ValueRef)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::put(QV4::Managed*, QV4::StringRef, QV4::ValueRef)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::Object(QV4::ExecutionEngine*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlValueType::staticMetaObject'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QShortcutMap::tryShortcutEvent(QObject*, QKeyEvent*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlProfilerService::instance()'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::engine() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::getLookup(QV4::Managed*, QV4::Lookup*)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::setSource(QUrl const&)@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::PersistentValue::operator=(QV4::ValueRef)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::ArrayData::realloc(QV4::Object*, QV4::ArrayData::Type, unsigned int, unsigned int, bool)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlInspectorService::addView(QObject*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlPropertyPrivate::setBinding(QQmlProperty const&, QQmlAbstractBinding*, QFlags)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlComponentPrivate::initializeObjectWithInitialProperties(QV4::ValueRef,
      QV4::ValueRef, QObject*)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::staticMetaObject@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlValueType::QQmlValueType(int, QObject*)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::x() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlDebugStream::QQmlDebugStream(QByteArray*,
      QFlags<QIODevice::OpenModeFlag>)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::window() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::~Object()'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickItem::mapToScene(QPointF const&) const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::deleteProperty(QV4::Managed*,
      QV4::StringRef)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickView::rootContext() const@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::getIndexed(QV4::Managed*, unsigned int, bool*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlDebugService::isDebuggingEnabled()' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::destroy(QV4::Managed*)'
      /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference toQQuickWindow::grabWindow()@Qt_5' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlValueType::metaObject() const'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlAbstractBinding::weakPointer()' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::get(QV4::Managed*, QV4::StringRef, bool*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QOpenGLContextPrivate::globalShareContext()' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Managed::setVTable(QV4::ManagedVTable const*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QQmlEngineDebugService::setStatesDelegate(QQmlDebugStatesDelegate*)' /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickView::status() const@Qt_5'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::construct(QV4::Managed*, QV4::CallData*)' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QQmlInspectorService::instance()'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::query(QV4::Managed const*, QV4::StringRef)' /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib/libQt5QuickTest.so: undefined reference to QQuickItem::width() const@Qt_5'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::Object::defineAccessorProperty(QV4::StringRef, unsigned long long ()(QV4::CallContext), unsigned long long ()(QV4::CallContext))' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to QV4::Object::advanceIterator(QV4::Managed*, QV4::ObjectIterator*,
      QV4::StringRef, unsigned int*, QV4::Property*,
      QV4::PropertyAttributes*)'
      /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to
      QV4::String::simplifyString() const' /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5: undefined reference to `QQmlInspectorService::removeView(QObject*)' collect2: error: ld returned 1 exit status Makefile:108: recipe for target '../../bin/qmltestrunner' failed make[3]: * [../../bin/qmltestrunner] Error 1 make[3]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/tools/qmltestrunner' Makefile:276: recipe for target 'sub-qmltestrunner-make_first' failed make[2]: * [sub-qmltestrunner-make_first] Error 2
    

    so, how can i fix this problem?

    thanks.



  • Should be moved to QtonPi Forum !



  • Although the article you linked says to do, it sounds strange to use the CROSS_COMPILE variable for a native build...
    If you don't really need the QtQuick you may try to build without this module. (Which means no QML either.)



  • thanks, but I need QML in my program.



  • I've solved this problem, and there is a new problem now.

    1. Before native building qt on pi, I installed qt by: sudo apt-get install qt5-default, and other qt5 packages.
      Although I have : sudo apt-get remove those packages, it may still works.
      so I formatted the SD card and re-burned an Raspbian image, followed the instructions, "make", and the problem is gone.

    2. but now I have another problem.
      When I "make install", I get this error:

    /usr/bin/g++ -Wl,-rpath-link,/opt/vc/lib -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -shared -o libdeclarative_location.so .obj/location.o .obj/qdeclarativegeomapitemview.o .obj/qdeclarativegeoserviceprovider.o .obj/qdeclarativegeocodemodel.o .obj/qdeclarativegeoroutemodel.o .obj/qdeclarativegeoroute.o .obj/qdeclarativegeoroutesegment.o .obj/qdeclarativegeomaneuver.o .obj/qdeclarativegeomap.o .obj/qdeclarativegeomaptype.o .obj/qdeclarativegeomapitembase.o .obj/qdeclarativegeomapquickitem.o .obj/qdeclarativecirclemapitem.o .obj/qdeclarativerectanglemapitem.o .obj/qdeclarativepolygonmapitem.o .obj/qdeclarativepolylinemapitem.o .obj/qdeclarativeroutemapitem.o .obj/qgeomapitemgeometry.o .obj/qdeclarativegeomapcopyrightsnotice.o .obj/error_messages.o .obj/locationvaluetypehelper.o .obj/qquickgeomapgesturearea.o .obj/qquickgeocoordinateanimation.o .obj/mapitemviewdelegateincubator.o .obj/qdeclarativeplacecontentmodel.o .obj/qdeclarativesupportedcategoriesmodel.o .obj/qdeclarativesearchsuggestionmodel.o .obj/qdeclarativesearchresultmodel.o .obj/qdeclarativereviewmodel.o .obj/qdeclarativeplaceimagemodel.o .obj/qdeclarativeplaceeditorialmodel.o .obj/qdeclarativecontactdetail.o .obj/qdeclarativecategory.o .obj/qdeclarativeplace.o .obj/qdeclarativeplaceattribute.o .obj/qdeclarativeplaceicon.o .obj/qdeclarativeplaceuser.o .obj/qdeclarativeratings.o .obj/qdeclarativesupplier.o .obj/qdeclarativesearchmodelbase.o .obj/moc_qdeclarativecirclemapitem_p.o .obj/moc_qdeclarativerectanglemapitem_p.o .obj/moc_qdeclarativepolygonmapitem_p.o .obj/moc_qdeclarativepolylinemapitem_p.o .obj/moc_qdeclarativeroutemapitem_p.o .obj/moc_qdeclarativegeomapcopyrightsnotice_p.o .obj/moc_qquickgeocoordinateanimation_p.o .obj/moc_qdeclarativeplacecontentmodel.o .obj/moc_qdeclarativesupportedcategoriesmodel_p.o .obj/moc_qdeclarativesearchsuggestionmodel_p.o .obj/moc_qdeclarativesearchresultmodel_p.o .obj/moc_qdeclarativereviewmodel_p.o .obj/moc_qdeclarativeplaceimagemodel_p.o .obj/moc_qdeclarativeplaceeditorialmodel.o .obj/moc_qdeclarativecontactdetail_p.o .obj/moc_qdeclarativecategory_p.o .obj/moc_qdeclarativeplace_p.o .obj/moc_qdeclarativeplaceattribute_p.o .obj/moc_qdeclarativeplaceicon_p.o .obj/moc_qdeclarativeplaceuser_p.o .obj/moc_qdeclarativeratings_p.o .obj/moc_qdeclarativesupplier_p.o .obj/moc_qdeclarativesearchmodelbase.o -L=/opt/vc/lib -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/lib -lQt5Location -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/lib -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtdeclarative/lib -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Core -Wl,-rpath-link,/opt/vc/lib -lGLESv2 -lpthread -lclip2tri -L/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/lib -lpoly2tri -lclipper
    /usr/bin/ld: cannot find -lclip2tri
    /usr/bin/ld: cannot find -lpoly2tri
    /usr/bin/ld: cannot find -lclipper

    collect2: error: ld returned 1 exit status
    Makefile:273: recipe for target '../../../qml/QtLocation/libdeclarative_location.so' failed
    make[4]: *** [../../../qml/QtLocation/libdeclarative_location.so] Error 1
    make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/imports/location'
    Makefile:80: recipe for target 'sub-location-install_subtargets' failed
    make[3]: *** [sub-location-install_subtargets] Error 2
    make[3]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/imports'
    Makefile:135: recipe for target 'sub-imports-install_subtargets' failed
    make[2]: *** [sub-imports-install_subtargets] Error 2
    make[2]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src'
    Makefile:56: recipe for target 'sub-src-install_subtargets' failed
    make[1]: *** [sub-src-install_subtargets] Error 2
    make[1]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation'
    Makefile:844: recipe for target 'module-qtlocation-install_subtargets' failed


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.