Results 1 to 4 of 4

Thread: static link version QT5 module qtxmlpatterns compile problem

  1. #1
    Join Date
    Feb 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default static link version QT5 module qtxmlpatterns compile problem

    Hi all,

    I'm building a static link version of QT by add -static to qtbase configure. The qtbase compile is fine. The I switch to qtxmlpatterns which compile fail with:
    Qt Code:
    1. | linking ../../bin/xmlpatterns
    2. | /opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/sysroots/x86_64-linux/usr/libexec/arm-linda-linux-gnueabi/gcc/arm-linda-linux-gnueabi/4.9.1/ld: warning: library search path "/usr/lib/qt5/plugins/bearer" is unsafe for cross-compilation
    3. | /opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/sysroots/x86_64-linux/usr/libexec/arm-linda-linux-gnueabi/gcc/arm-linda-linux-gnueabi/4.9.1/ld: cannot find -lqgenericbearer
    4. | collect2: error: ld returned 1 exit status
    5. | make[2]: *** [../../bin/xmlpatterns] Error 1
    6. | make[2]: Leaving directory `/opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/work/cortexa7hf-vfp-vfpv4-neon-linda-linux-gnueabi/qtxmlpatterns/5.3.2-r0/build/tools/xmlpatterns'
    To copy to clipboard, switch view to plain text mode 

    I find the Makefile generated by qmake for tools/xmlpatterns has the wrong LIBS:
    Qt Code:
    1. LIBS = $(SUBLIBS) -L/opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/work/cortexa7hf-vfp-vfpv4-neon-linda-linux-gnueabi/qtxmlpatterns/5.3.2-r0/build/lib -lQt5XmlPatterns -lQt5Network -lQt5Core -lz -lm -ldl -lrt -L/usr/lib/qt5/plugins/bearer -lqgenericbearer -lpthread
    To copy to clipboard, switch view to plain text mode 

    the share link version of the same Makefile's LIBS has no plugin link:
    Qt Code:
    1. LIBS = $(SUBLIBS) -L/opt/yocto/build/sunxi/linda-a20navi-base/tmp/work/cortexa7hf-vfp-vfpv4-neon-linda-linux-gnueabi/qtxmlpatterns/5.3.2-r0/build/lib -lQt5XmlPatterns -lQt5Network -lQt5Core -lpthread
    To copy to clipboard, switch view to plain text mode 

    It seems the plugin lib dir doesn't have a cross compile prefix. Any one meet this problem before or know how to fix static link plugin lib path?

    Thanks,
    Qiang

  2. #2
    Join Date
    Feb 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: static link version QT5 module qtxmlpatterns compile problem

    I find the problem:

    qt.prf:
    Qt Code:
    1. plugpath = $$[QT_INSTALL_PLUGINS/get]
    To copy to clipboard, switch view to plain text mode 

    both $$[QT_INSTALL_PLUGINS/get] and $$[QT_INSTALL_PLUGINS/raw] equal /usr/lib/qt5/plugins
    but $$[QT_INSTALL_PLUGINS] equals right path.

    Now my question is
    1. why there are three var of QT_INSTALL_PLUGINS?
    2. where are their values from?

    Thanks,
    Qiang

  3. #3
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: static link version QT5 module qtxmlpatterns compile problem

    Have you tried $$[QT_INSTALL_PLUGINS]/get and $$[QT_INSTALL_PLUGINS]/raw?

    Edit: Sorry, just realized that you are referencing qt.prf, not something you coded. Please disregard my reply.
    Last edited by jefftee; 6th February 2015 at 03:35.

  4. #4
    Join Date
    Feb 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: static link version QT5 module qtxmlpatterns compile problem

    I find some valuable info from
    https://github.com/meta-qt5/meta-qt5...ilding-with-OE

    Now I use $$[QT_INSTALL_PLUGINS] which qmake will prefix /usr/lib/plugins with SYSROOT.
    But the Makefile has another problem when upgrade to 5.4:
    Qt Code:
    1. LIBS = $(SUBLIBS) -L/opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/work/cortexa7hf-vfp-vfpv4-neon-linda-linux-gnueabi/qtxmlpatterns/5.4.0-r0/build/lib -lQt5XmlPatterns -L/opt/yocto-rel/yocto/0.1/build/linda-a20navi/tmp/sysroots/a20navi/usr/lib/qt5/plugins/bearer -lqgenericbearer -L${libdir} -lQt5Network -lQt5Core -lz -lm -ldl -lrt -lpthread
    To copy to clipboard, switch view to plain text mode 

    The ${libdir} expend to /usr/lib which is cross-compile unsafe.

    Regards,
    Qiang


    Added after 59 minutes:


    The libdir problem occurs when I change $$[QT_INSTALL_PLUGINS/get] to $$[QT_INSTALL_PLUGINS].
    Last edited by yuq825; 6th February 2015 at 06:35.

Similar Threads

  1. Replies: 0
    Last Post: 5th August 2012, 01:03
  2. Compile static version of Qt and wiki tutorial
    By Suppaman in forum Installation and Deployment
    Replies: 5
    Last Post: 26th May 2011, 20:55
  3. Replies: 2
    Last Post: 26th August 2009, 10:18
  4. QtXmlPatterns problem
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2008, 22:27
  5. Problem with libmng on static link
    By jlbrd in forum Installation and Deployment
    Replies: 2
    Last Post: 10th May 2006, 22:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.