qt5.5 cross-compilation gstreamer error



  • hi, can someone help me with this error:
    #################################################################################################
    GStreamer 0.10 auto-detection... ()
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -pthread -pthread -pthread -pthread -pthread -Wall -W -fPIC -I. -isystem /mnt/rasp-pi-rootfs/usr/include/gstreamer-0.10 -isystem /mnt/rasp-pi-rootfs/usr/include/glib-2.0 -I/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/glib-2.0/include -isystem /mnt/rasp-pi-rootfs/usr/include/libxml2 -I../../../mkspecs/devices/linux-rasp-pi-g++ -o gstreamer.o gstreamer.cpp
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -Wl,-O1 -o gstreamer gstreamer.o --sysroot=/mnt/rasp-pi-rootfs -lpthread -lpcre -L/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -lgstaudio-0.10 -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 -lgstpbutils-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -pthread -lglib-2.0 -lxml2
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libglib-2.0.a(libglib_2_0_la-gregex.o): undefined reference to symbol 'pcre_study'
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: note: 'pcre_study' is defined in DSO /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3 so try adding it to the linker command line
    /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    make: *** [gstreamer] Error 1
    GStreamer 0.10 disabled.
    GStreamer 1.0 auto-detection... ()
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -pthread -pthread -pthread -pthread -pthread -Wall -W -fPIC -I. -isystem /mnt/rasp-pi-rootfs/usr/include/gstreamer-1.0 -isystem /mnt/rasp-pi-rootfs/usr/include/glib-2.0 -I/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I../../../mkspecs/devices/linux-rasp-pi-g++ -o gstreamer.o gstreamer.cpp
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -Wl,-O1 -o gstreamer gstreamer.o --sysroot=/mnt/rasp-pi-rootfs -lpthread -lpcre -L/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -lgstaudio-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstpbutils-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libglib-2.0.a(libglib_2_0_la-gregex.o): undefined reference to symbol 'pcre_study'
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: note: 'pcre_study' is defined in DSO /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3 so try adding it to the linker command line
    /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    make: *** [gstreamer] Error 1
    GStreamer 1.0 disabled.
    GStreamer support cannot be enabled due to functionality tests!
    #################################################################################################

    what 'am i mising ? tried to add -lpcre to configure but no success, i had similiar error with pthread lib but adding -lpthread to configure fixed it. No success with -lpcre my current configure looks like this:

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -lpthread -gstreamer -lpcre -prefix /usr/local/qt5pi -skip qtwebkit -v

    i'am cross compiling for raspberry pi 2 on osx elcapitan, rootfs mounted, toolchain working as i compiled it before without gstreamer.
    any help would be appriciated


  • Lifetime Qt Champion

    Hi,

    Is it the system's libpcre ?



  • with -system-pcre added to configure i get this:
    PCRE auto-detection... ()
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi-g++ -o pcre.o pcre.cpp
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -Wl,-O1 -o pcre pcre.o --sysroot=/mnt/rasp-pi-rootfs -lpthread -lpcre16
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lpcre16
    collect2: error: ld returned 1 exit status
    make: *** [pcre] Error 1
    PCRE disabled.
    PCRE support cannot be enabled due to functionality tests!


  • Lifetime Qt Champion

    Do you have the development packages installed on your target ?



  • when using -system-pcre and sudo ln -s libpcre.so libpcre16.so i'am back to gstreamer error
    ##########################################################################
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libglib-2.0.a(libglib_2_0_la-gregex.o): undefined reference to symbol 'pcre_study'
    /Users/un/opt/rpi-tools/arm-linux-gnueabihf-osx/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: note: 'pcre_study' is defined in DSO /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3 so try adding it to the linker command line
    /mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf/libpcre.so.3: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    make: *** [gstreamer] Error 1
    GStreamer 1.0 disabled.
    GStreamer support cannot be enabled due to functionality tests!
    ##########################################################################



  • This post is deleted!


  • got it working, i have added -lpcre to pkg-config file o glib :)


  • Lifetime Qt Champion

    Since you added that symlink, it means that you don't have the pcre dev package installed



  • hm you are right but where from do i get libpcre16 ?
    after symlinking that lib i can configure but when i do "make" i get error connected with libpcre16 i think
    ##########################################################################
    ractstate.o .obj/moc_qstate.o .obj/moc_qfinalstate.o .obj/moc_qhistorystate.o .obj/moc_qabstracttransition.o .obj/moc_qsignaltransition.o .obj/moc_qeventtransition.o -lpthread -lz -lpcre16 -lm -ldl -lrt
    .obj/qthread_unix.o: In function QThreadPrivate::createEventDispatcher(QThreadData*)': qthread_unix.cpp:(.text+0x280): undefined reference toQEventDispatcherGlib::versionSupported()'
    qthread_unix.cpp:(.text+0x29c): undefined reference to QEventDispatcherGlib::QEventDispatcherGlib(QObject*)' .obj/qregularexpression.o: In functionpcre16SafeExec(real_pcre16 const*, pcre16_extra const*, unsigned short const*, int, int, int, int*, int)':
    qregularexpression.cpp:(.text+0x264): undefined reference to pcre16_exec' qregularexpression.cpp:(.text+0x2cc): undefined reference topcre16_jit_stack_alloc'
    qregularexpression.cpp:(.text+0x334): undefined reference to pcre16_exec' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::~QRegularExpressionPrivate()':
    qregularexpression.cpp:(.text+0x574): undefined reference to pcre16_free_study' qregularexpression.cpp:(.text+0x610): undefined reference topcre16_free'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::cleanCompiledPattern()': qregularexpression.cpp:(.text+0x6cc): undefined reference topcre16_free_study'
    qregularexpression.cpp:(.text+0x6f8): undefined reference to pcre16_free' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::getPatternInfo()':
    qregularexpression.cpp:(.text+0x718): undefined reference to pcre16_fullinfo' qregularexpression.cpp:(.text+0x72c): undefined reference topcre16_fullinfo'
    qregularexpression.cpp:(.text+0x780): undefined reference to pcre16_fullinfo' qregularexpression.cpp:(.text+0x7a4): undefined reference topcre16_config'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::compilePattern()': qregularexpression.cpp:(.text+0xa00): undefined reference topcre16_free_study'
    qregularexpression.cpp:(.text+0xa80): undefined reference to pcre16_compile2' qregularexpression.cpp:(.text+0xae4): undefined reference topcre16_free'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::optimizePattern(QRegularExpressionPrivate::OptimizePatternOption)': qregularexpression.cpp:(.text+0xb70): undefined reference topcre16_study'
    qregularexpression.cpp:(.text+0xc78): undefined reference to pcre16_assign_jit_stack' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::captureIndexForName(QString const&) const':
    qregularexpression.cpp:(.text+0xd48): undefined reference to pcre16_get_stringnumber' .obj/qregularexpression.o: In functionQRegularExpressionMatch::capturedRef(QString const&) const':
    qregularexpression.cpp:(.text+0x17a4): undefined reference to pcre16_get_stringnumber' .obj/qregularexpression.o: In functionQRegularExpressionMatch::captured(QString const&) const':
    qregularexpression.cpp:(.text+0x1904): undefined reference to pcre16_get_stringnumber' .obj/qregularexpression.o: In functionQRegularExpressionMatch::capturedStart(QString const&) const':
    qregularexpression.cpp:(.text+0x19c8): undefined reference to pcre16_get_stringnumber' .obj/qregularexpression.o: In functionQRegularExpressionMatch::capturedLength(QString const&) const':
    qregularexpression.cpp:(.text+0x1a6c): undefined reference to pcre16_get_stringnumber' .obj/qregularexpression.o:qregularexpression.cpp:(.text+0x1b10): more undefined references topcre16_get_stringnumber' follow
    .obj/qregularexpression.o: In function QRegularExpression::namedCaptureGroups() const': qregularexpression.cpp:(.text+0x4090): undefined reference topcre16_fullinfo'
    qregularexpression.cpp:(.text+0x40a8): undefined reference to pcre16_fullinfo' qregularexpression.cpp:(.text+0x40c0): undefined reference topcre16_fullinfo'
    .obj/qregularexpression.o: In function QThreadStorage<QPcreJitStackPointer*>::deleteData(void*)': qregularexpression.cpp:(.text._ZN14QThreadStorageIP20QPcreJitStackPointerE10deleteDataEPv[_ZN14QThreadStorageIP20QPcreJitStackPointerE10deleteDataEPv]+0x18): undefined reference topcre16_jit_stack_free'
    .obj/qcoreapplication.o: In function QCoreApplicationPrivate::createEventDispatcher()': qcoreapplication.cpp:(.text+0x9c): undefined reference toQEventDispatcherGlib::versionSupported()'
    qcoreapplication.cpp:(.text+0xb8): undefined reference to `QEventDispatcherGlib::QEventDispatcherGlib(QObject*)'
    collect2: error: ld returned 1 exit status
    make[3]: *** [../../lib/libQt5Core.so.5.5.1] Error 1
    make[2]: *** [sub-corelib-make_first] Error 2
    make[1]: *** [sub-src-make_first] Error 2
    make: *** [module-qtbase-make_first] Error 2
    ##########################################################################

    where from can i get libpcre16 ? i'am search using apt-cache search, and thats what i get:
    apt-cache search libpcre
    clisp-module-pcre - clisp module that adds libpcre support
    libpcre++-dev - C++ wrapper class for pcre (development)
    libpcre++0 - C++ wrapper class for pcre (runtime)
    libpcre-ocaml - OCaml bindings for PCRE (runtime)
    libpcre-ocaml-dev - OCaml bindings for PCRE (Perl Compatible Regular Expression)
    libpcre3 - Perl 5 Compatible Regular Expression Library - runtime files <- installed
    libpcre3-dbg - Perl 5 Compatible Regular Expression Library - debug symbols
    libpcre3-dev - Perl 5 Compatible Regular Expression Library - development files <- installed
    libpcrecpp0 - Perl 5 Compatible Regular Expression Library - C++ runtime files
    pcregrep - grep utility that uses perl 5 compatible regexes.


  • Lifetime Qt Champion

    Silly question but did you install these on your host or target ?



  • on my target :)


  • Lifetime Qt Champion

    Did you re-do the configuration after installing the missing dependencies ?



  • yes, many times.
    every time i change something in my setup i do
    make clean
    new ./configure command to try with different options
    make


  • Lifetime Qt Champion

    make clean is not enough, you need to start from a clean state.

    I recommend out of source builds so when something goes wrong you can just nuke the folder and you don't pollute the sources.



  • ok, i'am going to try today, so i need to remove whole Src folder, redownload and rerun whole process ?

    //edit
    same thing happened. i have completly removed Src folder, and redownloaded it with qt "maintaince tool"
    i'am stuck at:
    ###############################################################################################
    eventtransition.o -lpthread -lz -lpcre16 -lm -ldl -lrt
    .obj/qregularexpression.o: In function pcre16SafeExec(real_pcre16 const*, pcre16_extra const*, unsigned short const*, int, int, int, int*, int)': qregularexpression.cpp:(.text+0x264): undefined reference topcre16_exec'
    qregularexpression.cpp:(.text+0x2cc): undefined reference to pcre16_jit_stack_alloc' qregularexpression.cpp:(.text+0x334): undefined reference topcre16_exec'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::~QRegularExpressionPrivate()': qregularexpression.cpp:(.text+0x574): undefined reference topcre16_free_study'
    qregularexpression.cpp:(.text+0x610): undefined reference to pcre16_free' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::cleanCompiledPattern()':
    qregularexpression.cpp:(.text+0x6cc): undefined reference to pcre16_free_study' qregularexpression.cpp:(.text+0x6f8): undefined reference topcre16_free'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::getPatternInfo()': qregularexpression.cpp:(.text+0x718): undefined reference topcre16_fullinfo'
    qregularexpression.cpp:(.text+0x72c): undefined reference to pcre16_fullinfo' qregularexpression.cpp:(.text+0x780): undefined reference topcre16_fullinfo'
    qregularexpression.cpp:(.text+0x7a4): undefined reference to pcre16_config' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::compilePattern()':
    qregularexpression.cpp:(.text+0xa00): undefined reference to pcre16_free_study' qregularexpression.cpp:(.text+0xa80): undefined reference topcre16_compile2'
    qregularexpression.cpp:(.text+0xae4): undefined reference to pcre16_free' .obj/qregularexpression.o: In functionQRegularExpressionPrivate::optimizePattern(QRegularExpressionPrivate::OptimizePatternOption)':
    qregularexpression.cpp:(.text+0xb70): undefined reference to pcre16_study' qregularexpression.cpp:(.text+0xc78): undefined reference topcre16_assign_jit_stack'
    .obj/qregularexpression.o: In function QRegularExpressionPrivate::captureIndexForName(QString const&) const': qregularexpression.cpp:(.text+0xd48): undefined reference topcre16_get_stringnumber'
    .obj/qregularexpression.o: In function QRegularExpressionMatch::capturedRef(QString const&) const': qregularexpression.cpp:(.text+0x17a4): undefined reference topcre16_get_stringnumber'
    .obj/qregularexpression.o: In function QRegularExpressionMatch::captured(QString const&) const': qregularexpression.cpp:(.text+0x1904): undefined reference topcre16_get_stringnumber'
    .obj/qregularexpression.o: In function QRegularExpressionMatch::capturedStart(QString const&) const': qregularexpression.cpp:(.text+0x19c8): undefined reference topcre16_get_stringnumber'
    .obj/qregularexpression.o: In function QRegularExpressionMatch::capturedLength(QString const&) const': qregularexpression.cpp:(.text+0x1a6c): undefined reference topcre16_get_stringnumber'
    .obj/qregularexpression.o:qregularexpression.cpp:(.text+0x1b10): more undefined references to pcre16_get_stringnumber' follow .obj/qregularexpression.o: In functionQRegularExpression::namedCaptureGroups() const':
    qregularexpression.cpp:(.text+0x4090): undefined reference to pcre16_fullinfo' qregularexpression.cpp:(.text+0x40a8): undefined reference topcre16_fullinfo'
    qregularexpression.cpp:(.text+0x40c0): undefined reference to pcre16_fullinfo' .obj/qregularexpression.o: In functionQThreadStorage<QPcreJitStackPointer*>::deleteData(void*)':
    qregularexpression.cpp:(.text._ZN14QThreadStorageIP20QPcreJitStackPointerE10deleteDataEPv[_ZN14QThreadStorageIP20QPcreJitStackPointerE10deleteDataEPv]+0x18): undefined reference to `pcre16_jit_stack_free'
    collect2: error: ld returned 1 exit status
    make[3]: *** [../../lib/libQt5Core.so.5.5.1] Error 1
    make[2]: *** [sub-corelib-make_first] Error 2
    make[1]: *** [sub-src-make_first] Error 2
    make: *** [module-qtbase-make_first] Error 2
    ###############################################################################################


  • Lifetime Qt Champion

    What distribution are you running on your Pi ?



  • newest jessie

    hmm i searched my mac for pcre libs as i think that something confuses qt and i found one occurence of libpcre16 located in /brew2/local/Cellar/pcre
    its dependency for something installed via homebrew
    is it possible that its source of my failures ? :)


  • Lifetime Qt Champion

    That possibly can interfere. Note that I'm more used to cross-compilation from Linux host. It make things way easier.



  • after 2 weeks got it working... tried on my macbook air with almost clean el capitan :)
    to many libs, projects, work stuff on my mac pro and i can't find the problem, maybe something connected to homebrew (something like apt-get in linux) installations.

    for anyone who stumble upon this thread that should be a good lesson -> clean system = simple compilation :)

    thanks for help SGaist :)


  • Lifetime Qt Champion

    Good !

    You're welcome !

    Then please, mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)



  • @unnamed
    Hi.
    I encountered same problem, would you please tell what did you do to solve the problem?
    By the way, what do you mean by " i have added -lpcre to pkg-config file o glib :)"?
    Thanks in advance.


Log in to reply
 

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