problem in running Qt app on nanoPC-T2



  • I use this guide document to install cross compiler 4.9.3 and also qt4.8.6. http://wiki.friendlyarm.com/wiki/index.php/Ubuntu_Core_with_Qt-Embedded#Develop_Qt_Application
    this said:"
    Install Qt-Embedded on Host PC

    *Visit the product page of one of the following products and download the target-ate-4.8.6-to-hostpc.tgz file:

    NanoPi2, NanoPi M2, NanoPi T2: Download
    

    Enter the root directory and uncompress the file:

    cd /
    tar xvzf ~/target-ate-4.8.6-to-hostpc.tgz

    After it is done verify it by using the following command:

    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake -v

    If you install it successfully you will get the following information:
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib
    Install Cross Compiler on Host PC (arm-linux-gcc 4.9.3)

    Download and uncompress the compiler:

    git clone https://github.com/friendlyarm/prebuilts.git
    sudo mkdir -p /opt/FriendlyARM/toolchain
    sudo tar xf prebuilts/gcc-x64/arm-cortexa9-linux-gnueabihf-4.9.3.tar.xz -C /opt/FriendlyARM/toolchain/

    Add the compiler's directory to "PATH" and append the following lines in "~/.bashrc":

    export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin:$PATH
    export GCC_COLORS=auto

    Run "~/.bashrc" to make your setting effective. Attention: there is a space after ".":

    . ~/.bashrc

    This compiler is a 64-bit one therefore it cannot be run on a 32-bit Linux machine. After the compiler is installed you can verify it by running the following commands:

    arm-linux-gcc -v
    Using built-in specs.
    COLLECT_GCC=arm-linux-gcc
    COLLECT_LTO_WRAPPER=/opt/FriendlyARM/toolchain/4.9.3/libexec/gcc/arm-cortexa9-linux-gnueabihf/4.9.3/lto-wrapper
    Target: arm-cortexa9-linux-gnueabihf
    Configured with: /work/toolchain/build/src/gcc-4.9.3/configure --build=x86_64-build_pc-linux-gnu
    --host=x86_64-build_pc-linux-gnu --target=arm-cortexa9-linux-gnueabihf --prefix=/opt/FriendlyARM/toolchain/4.9.3
    --with-sysroot=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-languages=c,c++
    --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3 --with-float=hard
    ...
    Thread model: posix
    gcc version 4.9.3 (ctng-1.21.0-229g-FA)
    "*
    after all, I click on tools>options>build and run>tools chain add the 4.9.3 arm-linux-gcc and add gdb when I copy the program to my device these errors display:

    root@NanoPC-T2:~# . setqt4env
    ctp = 1
    root@NanoPC-T2:~# test2 -qws &
    [1] 1007
    -bash: test2: command not found
    root@NanoPC-T2:~# test2 -qws&
    [2] 1008
    [1]   Exit 127                test2 -qws
    -bash: test2: command not found
    root@NanoPC-T2:~# test2 -qws
    -bash: test2: command not found
    

    where is the problem?


  • Moderators

    @MhM93

    ./test2 -qws &
    

    You need to put ./ in front of your command - by default Linux does not look for binaries in current directory for security reasons.



  • thanx for reply @jsulm :

    root@NanoPC-T2:~# ./test2 -qws &
    [1] 1031
    -bash: ./test2: Permission denied
    root@NanoPC-T2:~# chmod 777 test2
    [1]+  Exit 126                ./test2 -qws
    root@NanoPC-T2:~# ./test2 -qws &
    [1] 1034
    root@NanoPC-T2:~# ./test2: error while loading shared libraries: ./test2: unsupported version 9813 of Verneed record
    

    what is last error?


  • Moderators

    @MhM93 Well, it tells you what is wrong: one of the shared libraries your application needs has a wrong version.
    Do

    ldd test2
    

    to see which libraries are needed. You probably need to deploy your app properly to your target, means: copy needed libraries as well. For more information see: http://doc.qt.io/qt-5/linux-deployment.html



  • root@NanoPC-T2:/# ldd ./test2
        not a dynamic executable
    

  • Moderators

    @MhM93 What does

    file test2
    

    say?



  • [sorry for delay, last day I can not access my device to test. so sorry]
    file test2 is show this result.
    test2: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading (Invalid argument)

    It said 32 bit compiler, when I download the gcc I extract gccx64
    git clone https://github.com/friendlyarm/prebuilts.git
    sudo mkdir -p /opt/FriendlyARM/toolchain
    sudo tar xf prebuilts/gcc-x64/arm-cortexa9-linux-gnueabihf-4.9.3.tar.xz -C /opt/FriendlyARM/toolchain/

    this is my output for this command:

    fgit@ubuntu:~$ arm-linux-gcc -v
    Using built-in specs.
    COLLECT_GCC=arm-linux-gcc
    COLLECT_LTO_WRAPPER=/opt/FriendlyARM/toolchain/4.9.3/libexec/gcc/arm-cortexa9-linux-gnueabih![0_1494051336492_89307ef9e388679812dd0b5cd1e6dd49.jpg](/uploads/files/1494051338004-89307ef9e388679812dd0b5cd1e6dd49.jpg) f/4.9.3/lto-wrapper
    Target: arm-cortexa9-linux-gnueabihf
    Configured with: /work/toolchain/build/src/gcc-4.9.3/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=arm-cortexa9-linux-gnueabihf --prefix=/opt/FriendlyARM/toolchain/4.9.3 --with-sysroot=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-languages=c,c++ --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3 --with-float=hard --with-pkgversion=ctng-1.21.0-229g-FA --with-bugurl=http://www.friendlyarm.com/ --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-mpfr=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-mpc=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-isl=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-cloog=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-libelf=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-gold --disable-multilib --with-local-prefix=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-long-long
    Thread model: posix
    gcc version 4.9.3 (ctng-1.21.0-229g-FA)
    

    but in qt :![image]0_1494051323615_unnamed.png )

    when I attach the compiler in the ABIs write : arm-linux-generic-elf-32



  • could any one help me?
    I am confused


  • Moderators

    @MhM93 "It said 32 bit compiler, when I download the gcc I extract gccx64" - the compiler itself is a x86_64 (64bit) binary - this does not mean that it generates 64bit binaries. You are building for ARM 32bit, so it generates ARM 32bit binaries.

    You should do this (as I suggested before) on your target device:

    ldd ./test2
    

    It will should you which libraries are used by your executable.

    "./test2: error while loading shared libraries: ./test2: unsupported version 9813 of Verneed record" - says that one of the libraries on your target has the wrong version number.



  • Hi and thanx for reply, I do that if you see above post:

    root@NanoPC-T2:/# ldd ./test2
            not a dynamic executable
    
    root@NanoPC-T2:/# strace ./test2
    execve("./test2", ["./test2"], [/* 20 vars */]) = 0
    brk(NULL)                               = 0x24000
    uname({sysname="Linux", nodename="NanoPC-T2", ...}) = 0
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6faf000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    writev(2, [{"./test2", 7}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"./test2", 7}, {": ", 2}, {"unsupported version 9813 of Vern"..., 43}, {"", 0}, {"", 0}, {"\n", 1}], 10./test2: error while loading shared libraries: ./test2: unsupported version 9813 of Verneed record
    
    ) = 100
    exit_group(127)                         = ?
    +++ exited with 127 +++
    root@NanoPC-T2:/# file ./test2
    
    ./test2: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading (Invalid argument)
    root@NanoPC-T2:/#
    

    how to fix thislibrary version?


  • Moderators

    @MhM93 said in problem in running Qt app on nanoPC-T2:

    Verneed record

    Something is wrong with your executable. Can you show the whole build log (compiler output)?



  • this is my file:
    https://ufile.io/l2wkq
    I first wrote it in qt, then compile it


  • Moderators

    @MhM93 I'm not going to build this (I would need to install the same build tools first), so please post the build log...



  • @jsulm :these links are my build tools
    http://www.mediafire.com/file/g0afghia7rkqx05/arm-cortexa9-linux-gnueabihf-4.9.3-20160512.tar.xz
    http://www.mediafire.com/file/d54dbygdadergl1/target-qte-4.8.6-to-hostpc.tgz
    and this is my make log:

    fgit@ubuntu:~/prjX64/test/test2$ make
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/uic mainwindow.ui -o ui_mainwindow.h
    arm-linux-g++ -c -pipe -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/mkspecs/qws/linux-armv7-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include -I. -I. -I. -I/tmp/FriendlyARM/nanopi2/libs/usr/include -o main.o main.cpp
    arm-linux-g++ -c -pipe -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/mkspecs/qws/linux-armv7-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include -I. -I. -I. -I/tmp/FriendlyARM/nanopi2/libs/usr/include -o mainwindow.o mainwindow.cpp
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/moc -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/mkspecs/qws/linux-armv7-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include -I. -I. -I. -I/tmp/FriendlyARM/nanopi2/libs/usr/include mainwindow.h -o moc_mainwindow.cpp
    arm-linux-g++ -c -pipe -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/mkspecs/qws/linux-armv7-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.8.6-arm/include -I. -I. -I. -I/tmp/FriendlyARM/nanopi2/libs/usr/include -o moc_mainwindow.o moc_mainwindow.cpp
    arm-linux-g++ -Wl,-rpath-link,/tmp/FriendlyARM/nanopi2/libs/usr/lib -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -o test2 main.o mainwindow.o moc_mainwindow.o    -L/tmp/FriendlyARM/nanopi2/libs/usr/lib -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -L/tmp/FriendlyARM/nanopi2/libs/usr/lib -lQtNetwork -lQtCore -lpthread 
    fgit@ubuntu:~/prjX64/test/test2$ /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake -v
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib
    fgit@ubuntu:~/prjX64/test/test5$ /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake -v
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib
    

    when I decide to install another new empty ubuntu16.4 on vmware and install just these tool chains and do the document I have this error for make command.:

    root@ubuntu:/# /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake -v
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib
    
    fgit@ubuntu:~/helloqt$ make
    arm-linux-g++ -Wl,-rpath-link,/tmp/FriendlyARM/nanopi2/libs/usr/lib -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -o helloqt main.o    -L/tmp/FriendlyARM/nanopi2/libs/usr/lib -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -L/tmp/FriendlyARM/nanopi2/libs/usr/lib -lQtNetwork -lQtCore -lpthread 
    /opt/FriendlyARM/toolchain/4.9.3/lib/gcc/arm-cortexa9-linux-gnueabihf/4.9.3/../../../../arm-cortexa9-linux-gnueabihf/bin/ld.bfd: warning: libts-1.0.so.0, needed by /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/FriendlyARM/toolchain/4.9.3/lib/gcc/arm-cortexa9-linux-gnueabihf/4.9.3/../../../../arm-cortexa9-linux-gnueabihf/bin/ld.bfd: warning: libz.so.1, needed by /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `deflateInit_'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `deflateInit2_'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `compress'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtCore.so: undefined reference to `uncompress'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `deflate'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtCore.so: undefined reference to `compress2'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `deflateEnd'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `crc32'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `inflate'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `inflateInit2_'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `inflateInit_'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_read_raw'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `inflateEnd'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_open'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_fd'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_config'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `inflateReset'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `deflateReset'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_close'
    /usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib/libQtGui.so: undefined reference to `ts_read'
    collect2: error: ld returned 1 exit status
    Makefile:103: recipe for target 'helloqt' failed
    make: *** [helloqt] Error 1
    fgit@ubuntu:~/helloqt$
    

    but in the last Ubuntu(that Ubuntu I compiled test2), I had install Qt-everywhere-4.8.6 then I Installed these tool chain on Ubuntu and compile my project successfully and when I copied to device I saw the errors"test2: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading"


Log in to reply
 

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