Native build Qt 5.7.1 on raspberry pi get errors:/usr/bin/ld: cannot find -lclip2tri



  • 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

    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.

    I have run configure and make commands successfully.
    I tried to make install and got errors:

    /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
    make: *** [module-qtlocation-install_subtargets] Error 2

    I found there are 3 directories in qtlocation/src/3rdparty

    • clip2tri
    • clipper
    • poly2tri

    and 3 file in qtlocation/lib:

    • libclip2tri.prl
    • libclipper.prl
    • libpoly2tri.prl

    but no lib files.

    So, what can I do? Thanks.



  • I checked the build log, it seems cpp file in the directoriy qtlocation/src/3rdparty are not compiled,

    cd 3rdparty/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/3rdparty.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
    make[3]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty'
    cd poly2tri/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri/poly2tri.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
    make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri'
    make[4]: Nothing to be done for 'install'.
    make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri'
    cd clipper/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper/clipper.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
    make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper'
    make[4]: Nothing to be done for 'install'.
    make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clipper'
    cd clip2tri/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri/clip2tri.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
    make[4]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri'
    make[4]: Nothing to be done for 'install'.
    make[4]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/clip2tri'
    make[3]: Leaving directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty'
    cd location/ && ( test -e Makefile || /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qmake /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/location/location.pro -qtconf /home/pi/download/qt-everywhere-opensource-src-5.7.1/qtbase/bin/qt.conf -o Makefile ) && make -f Makefile install
    make[3]: Entering directory '/home/pi/download/qt-everywhere-opensource-src-5.7.1/qtlocation/src/location'



  • I checked the qt-everywhere-opensource-src-5.7.1/qtlocation/src/3rdparty/poly2tri/Makefile, which seems to compile nothing.

    install_html_docs:
    
    uninstall_html_docs:
    
    install_qch_docs:
    
    uninstall_qch_docs:
    
    install_docs:
    
    uninstall_docs:
    
    qch_docs:
    
    prepare_docs:
    

    and this:

    install:  FORCE
    
    uninstall:  FORCE
    
    FORCE:


  • Same issue here, super annoying. I might try 5.6.2 and see if the issue persists.



  • I'm also struggling with the native build. I'm using the latest version of stock Raspbian Pixel (2017-01-11-raspbian-jessie) on a Raspberry Pi 3. I'm also following the https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi guide, but I skipped the USB sections and just ran make with a single processor. I'm also switching to the linux-rpi3-g++ device. I haven't been able to run the make command successfully.

    The first issue I ran into was a build failure with the error:
    fatal error: bcm_host.h: No such file or directory

    I resolved it using the response from djunjunjun to modify the INCLUDEPATH in the qmake.conf file
    https://forum.qt.io/topic/62264/failed-to-cross-compile-qt-5-6-on-rpi-2-fatal-error-bcm_host-h-no-such-file-or-directory

    Now I'm running into an issue with Wayland:
    ./../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp:126:93: error: invalid conversion from ‘Window {aka long unsigned int}’ to ‘EGLNativeWindowType {aka void*}’ [-fpermissive]
    m_surface = eglCreateWindowSurface(m_glxIntegration->eglDisplay(), m_config, m_xWindow,0);

    I'm going to try to disable QtWayland since my application won't require it using the advice here:
    http://stackoverflow.com/questions/34223146/how-to-disable-the-qt-wayland-module-during-qt-build

    Besides just documenting my issues for the next person to come along, my question for expressw and yogsodoth is what are the Raspberry Pi/Raspbian versions you are using? There must be something different for you to be getting past the errors I'm seeing.



  • Hello,

    Almost two years in the future, but I'm answering to this because I had those very same problems with Qt 5.10 and maybe I can help somebody else (because I gave up trying to compile natively the 5.12.3 LTS by now).
    I'm using a Raspberry pi 3B with Raspbian Stretch.
    How I did solve that?
    I've 'cd' to the sources folder inside the build directory, so in my case:

    // cd to each directory and do 'sudo make' to each of them:
    ~/build/qtlocation/src/3rdparty/clip2tri
    ~/build/qtlocation/src/3rdparty/clipper
    ~/build/qtlocation/src/3rdparty/poly2tri
    

    There is a Makefile inside each of the directories which you can compile as root (sudo), I don't know why as root, but ok.
    After that, I've tried to "make install" again from the build dir and... It worked! Qt installed...


Log in to reply