Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. my cross compiler has error.tslib install but has error

my cross compiler has error.tslib install but has error

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
47 Posts 3 Posters 18.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MhM93M Offline
    MhM93M Offline
    MhM93
    wrote on last edited by MhM93
    #19

    when I did not use sudo this error display:

    fgit@ubuntu:~/tslib$ ./configure --host=arm-linux --prefix=/home/fgit/libts --enable-
    
    shared=yes --enable-static=no
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for arm-linux-strip... arm-none-linux-gnueabihf-strip
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... no
    checking for mawk... mawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether make supports nested variables... (cached) yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... arm-unknown-linux-gnu
    checking for arm-linux-gcc... arm-none-linux-gnueabihf-gcc
    checking whether the C compiler works... no
    configure: error: in `/home/fgit/tslib':
    configure: error: C compiler cannot create executables
    See `config.log' for more details
    

    I dont know why?
    I use that lib in my .pro file

    ######################################################################
    # Automatically generated by qmake (2.01a) Wed May 10 21:39:17 2017
    ######################################################################
    
    TEMPLATE = app
    TARGET = 
    DEPENDPATH += .
    INCLUDEPATH += .
    LIBS += -L/home/fgit/libts/lib -ltslib
    # Input
    SOURCES += main.cpp
    

    this error

    git@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 -L/home/fgit/libts/lib -ltslib -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: cannot find -ltslib
    collect2: error: ld returned 1 exit status
    Makefile:103: recipe for target 'helloqt' failed
    make: *** [helloqt] Error 1
    

    I change .pro to this and this is the error:

    ######################################################################
    # Automatically generated by qmake (2.01a) Wed May 10 21:39:17 2017
    ######################################################################
    
    TEMPLATE = app
    TARGET = 
    DEPENDPATH += .
    INCLUDEPATH += .
    LIBS += -L/home/fgit/libts/lib -lts
    # Input
    SOURCES += main.cpp
    

    0_1494482094283_Untitled.jpg

    H.Ghassami

    jsulmJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #20

      Then there's something messed up with your cross-compiler installation. You shouldn't need to be root to cross-compile.

      First thing ensure that you are doing that from a clean state. Then check the complete log as to why the configure script can't use the cross-compiler properly.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • MhM93M MhM93

        when I did not use sudo this error display:

        fgit@ubuntu:~/tslib$ ./configure --host=arm-linux --prefix=/home/fgit/libts --enable-
        
        shared=yes --enable-static=no
        checking for a BSD-compatible install... /usr/bin/install -c
        checking whether build environment is sane... yes
        checking for arm-linux-strip... arm-none-linux-gnueabihf-strip
        checking for a thread-safe mkdir -p... /bin/mkdir -p
        checking for gawk... no
        checking for mawk... mawk
        checking whether make sets $(MAKE)... yes
        checking whether make supports nested variables... yes
        checking whether make supports nested variables... (cached) yes
        checking build system type... x86_64-pc-linux-gnu
        checking host system type... arm-unknown-linux-gnu
        checking for arm-linux-gcc... arm-none-linux-gnueabihf-gcc
        checking whether the C compiler works... no
        configure: error: in `/home/fgit/tslib':
        configure: error: C compiler cannot create executables
        See `config.log' for more details
        

        I dont know why?
        I use that lib in my .pro file

        ######################################################################
        # Automatically generated by qmake (2.01a) Wed May 10 21:39:17 2017
        ######################################################################
        
        TEMPLATE = app
        TARGET = 
        DEPENDPATH += .
        INCLUDEPATH += .
        LIBS += -L/home/fgit/libts/lib -ltslib
        # Input
        SOURCES += main.cpp
        

        this error

        git@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 -L/home/fgit/libts/lib -ltslib -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: cannot find -ltslib
        collect2: error: ld returned 1 exit status
        Makefile:103: recipe for target 'helloqt' failed
        make: *** [helloqt] Error 1
        

        I change .pro to this and this is the error:

        ######################################################################
        # Automatically generated by qmake (2.01a) Wed May 10 21:39:17 2017
        ######################################################################
        
        TEMPLATE = app
        TARGET = 
        DEPENDPATH += .
        INCLUDEPATH += .
        LIBS += -L/home/fgit/libts/lib -lts
        # Input
        SOURCES += main.cpp
        

        0_1494482094283_Untitled.jpg

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #21

        @MhM93 said in my cross compiler has error.tslib install but has error:

        I change .pro to this and this is the error:

        What is the error?
        Did you rerun qmake after changing the pro file?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • MhM93M Offline
          MhM93M Offline
          MhM93
          wrote on last edited by MhM93
          #22

          @jsulm :yes, I change .pro and and run qmake and then make command. the error is in the picture
          @SGaist I want to run another new ubuntu to install of them from the first. all of the things need /usr/ directory should come with sudo command. so my compiler install with sudo command. I decide to do all steps again with new ubuntu. (this is my 3rd ubuntu :D ) I wish I can

          H.Ghassami

          jsulmJ 1 Reply Last reply
          0
          • MhM93M MhM93

            @jsulm :yes, I change .pro and and run qmake and then make command. the error is in the picture
            @SGaist I want to run another new ubuntu to install of them from the first. all of the things need /usr/ directory should come with sudo command. so my compiler install with sudo command. I decide to do all steps again with new ubuntu. (this is my 3rd ubuntu :D ) I wish I can

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #23

            @MhM93 Picture sharing does not work here. Please post the error text.

            "all of the things need /usr/ directory" - why do you want to have the stuff in /usr?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • MhM93M Offline
              MhM93M Offline
              MhM93
              wrote on last edited by
              #24
              git@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 -L/home/fgit/libts/lib -ltslib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.8.6-arm/lib -L/tmp/FriendlyARM/nanopi2/libs/usr/lib -lQtNetwork -lQtCore -lpthread 
              /home/fgit/libts/libts.so:file not recognized:File format not recognized
              collect2: error: ld returned 1 exit status
              Makefile:103: recipe for target 'helloqt' failed
              make: *** [helloqt] Error 1
              

              that is the error. when I extract the zip file they placed in /usr/local/ directory. I can not change the directory. This toolchain is https://www.mediafire.com/folder/ilkcy37otd7il/NanoPi2Board#a0l72ygtz0797 that I download and install it

              H.Ghassami

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #25

                What does file libts.so return ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • MhM93M Offline
                  MhM93M Offline
                  MhM93
                  wrote on last edited by
                  #26
                  fgit@ubuntu:~$ file ~/libts/lib/libts.so
                  /home/fgit/libts/lib/libts.so: symbolic link to libts.so.0.7.0
                  fgit@ubuntu:~$ file ~/libts/lib/libts.so.0.7.0 
                  /home/fgit/libts/lib/libts.so.0.7.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a6de3ac1d75c3420a9ecfb7bd34a42bda7524169, not stripped
                  fgit@ubuntu:~$
                  

                  H.Ghassami

                  jsulmJ 1 Reply Last reply
                  0
                  • MhM93M MhM93
                    fgit@ubuntu:~$ file ~/libts/lib/libts.so
                    /home/fgit/libts/lib/libts.so: symbolic link to libts.so.0.7.0
                    fgit@ubuntu:~$ file ~/libts/lib/libts.so.0.7.0 
                    /home/fgit/libts/lib/libts.so.0.7.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a6de3ac1d75c3420a9ecfb7bd34a42bda7524169, not stripped
                    fgit@ubuntu:~$
                    
                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #27

                    @MhM93 You built it for X86 not for ARM...

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • MhM93M Offline
                      MhM93M Offline
                      MhM93
                      wrote on last edited by
                      #28

                      but I do this with my compiler path

                      export PATH=/usr/local/arm/4.7.0/bin:$PATH
                      export CROSS_COMPILE=arm-none-linux-gnueabi-
                      export CC=${CROSS_COMPILE}gcc
                      export CFLAGS=-march=armv7l
                      export CXX=${CROSS_COMPILE}"g++" 
                      export AR=${CROSS_COMPILE}"ar" 
                      export AS=${CROSS_COMPILE}"as"
                      export RANLIB=${CROSS_COMPILE}"ranlib"
                      export LD=${CROSS_COMPILE}"ld"
                      export STRIP=${CROSS_COMPILE}"strip"
                      export ac_cv_func_malloc_0_nonnull=yes
                      

                      H.Ghassami

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #29

                        Check the configure script options. There's something like --host=arm-none-linux-gnueabi IIRC.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • MhM93M Offline
                          MhM93M Offline
                          MhM93
                          wrote on last edited by
                          #30

                          really thanksssssssssssssssssssssssssss
                          It compile without error with this command, at last.

                          sudo ./configure --host=arm-none-linux-gnueabihf --prefix=/home/tslib --enable-shared=yes --enable-static=no
                          

                          but when I copy the exe file to my arm device it again show me this error:

                          root@NanoPC-T2:/# tftp 192.168.101.4
                          tftp> get helloqt
                          Received 11692 bytes in 0.4 seconds
                          tftp> quit
                          root@NanoPC-T2:/# . setqt4env
                          ctp = 1
                          root@NanoPC-T2:/# chmod +x helloqt
                          root@NanoPC-T2:/# ./helloqt -qws &
                          [1] 1409
                          root@NanoPC-T2:/# ./helloqt -qws
                          [1]+  Segmentation fault      ./helloqt -qws
                          Segmentation fault
                          root@NanoPC-T2:/# ldd ./helloqt
                                  not a dynamic executable
                          root@NanoPC-T2:/# file ./helloqt
                          ./helloqt: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading (Invalid argument)
                          
                          

                          H.Ghassami

                          jsulmJ 1 Reply Last reply
                          0
                          • MhM93M MhM93

                            really thanksssssssssssssssssssssssssss
                            It compile without error with this command, at last.

                            sudo ./configure --host=arm-none-linux-gnueabihf --prefix=/home/tslib --enable-shared=yes --enable-static=no
                            

                            but when I copy the exe file to my arm device it again show me this error:

                            root@NanoPC-T2:/# tftp 192.168.101.4
                            tftp> get helloqt
                            Received 11692 bytes in 0.4 seconds
                            tftp> quit
                            root@NanoPC-T2:/# . setqt4env
                            ctp = 1
                            root@NanoPC-T2:/# chmod +x helloqt
                            root@NanoPC-T2:/# ./helloqt -qws &
                            [1] 1409
                            root@NanoPC-T2:/# ./helloqt -qws
                            [1]+  Segmentation fault      ./helloqt -qws
                            Segmentation fault
                            root@NanoPC-T2:/# ldd ./helloqt
                                    not a dynamic executable
                            root@NanoPC-T2:/# file ./helloqt
                            ./helloqt: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading (Invalid argument)
                            
                            
                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by jsulm
                            #31

                            @MhM93 said in my cross compiler has error.tslib install but has error:

                            [1]+ Segmentation fault ./helloqt -qws

                            This is another problem. Try to start your app in a debugger to see what happens.
                            Also why do you start it twice:

                            root@NanoPC-T2:/# ./helloqt -qws &
                            [1] 1409
                            root@NanoPC-T2:/# ./helloqt -qws
                            

                            ?

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • MhM93M Offline
                              MhM93M Offline
                              MhM93
                              wrote on last edited by
                              #32

                              I do not install qt creator to see debug mood in my pc, and also this program is run on nanopc-t2 when I wrote this command it returns :

                              root@NanoPC-T2:/# strace ./helloqt
                              execve("./helloqt", ["./helloqt"], [/* 20 vars */]) = 0
                              brk(NULL)                               = 0x21000
                              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) = 0xb6f67000
                              access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
                              --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4} ---
                              +++ killed by SIGSEGV +++
                              Segmentation fault
                              

                              Also why do you start it twice:
                              with silly reason. I just test what happen to run command with & and without it. :)

                              H.Ghassami

                              jsulmJ 2 Replies Last reply
                              0
                              • MhM93M MhM93

                                I do not install qt creator to see debug mood in my pc, and also this program is run on nanopc-t2 when I wrote this command it returns :

                                root@NanoPC-T2:/# strace ./helloqt
                                execve("./helloqt", ["./helloqt"], [/* 20 vars */]) = 0
                                brk(NULL)                               = 0x21000
                                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) = 0xb6f67000
                                access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
                                --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4} ---
                                +++ killed by SIGSEGV +++
                                Segmentation fault
                                

                                Also why do you start it twice:
                                with silly reason. I just test what happen to run command with & and without it. :)

                                jsulmJ Offline
                                jsulmJ Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on last edited by
                                #33

                                @MhM93 You don't need to install QtCreator to debug (QtCreator itself does not have a debugger). Just install gdb on your target device and use it. It looks like your app is running except you try to run two instances at the same time.

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • MhM93M MhM93

                                  I do not install qt creator to see debug mood in my pc, and also this program is run on nanopc-t2 when I wrote this command it returns :

                                  root@NanoPC-T2:/# strace ./helloqt
                                  execve("./helloqt", ["./helloqt"], [/* 20 vars */]) = 0
                                  brk(NULL)                               = 0x21000
                                  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) = 0xb6f67000
                                  access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
                                  --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4} ---
                                  +++ killed by SIGSEGV +++
                                  Segmentation fault
                                  

                                  Also why do you start it twice:
                                  with silly reason. I just test what happen to run command with & and without it. :)

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #34

                                  @MhM93 See here: http://stackoverflow.com/questions/1656891/problems-with-multiple-qapplications

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • MhM93M Offline
                                    MhM93M Offline
                                    MhM93
                                    wrote on last edited by
                                    #35

                                    thanks for reply. but i just play one application.
                                    oot@NanoPC-T2:/# rm helloqt
                                    root@NanoPC-T2:/# tftp 192.168.101.4
                                    tftp> get helloqt
                                    Received 11692 bytes in 0.5 seconds
                                    tftp> quit
                                    root@NanoPC-T2:/# chmod +x helloqt
                                    root@NanoPC-T2:/# ./helloqt -qws
                                    Segmentation fault
                                    root@NanoPC-T2:/# file ./helloqt
                                    ./helloqt: 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:/#

                                    H.Ghassami

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #36

                                      Again, run it through the debugger.

                                      By the way, what is the exact architecture of your device ?
                                      What Linux distribution are you running on it ?

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0
                                      • MhM93M Offline
                                        MhM93M Offline
                                        MhM93
                                        wrote on last edited by MhM93
                                        #37

                                        thanks for reply,
                                        I should install debugger on my host or on my target?
                                        this is my device:

                                        root@NanoPC-T2:/# uname -a
                                        Linux NanoPC-T2 3.4.39-s5p4418 #1 SMP PREEMPT Wed Mar 1 13:21:10 HKT 2017 armv7l armv7l armv7l GNU/Linux
                                        

                                        when I run gdb on my device (nanopc-t2):

                                        root@NanoPC-T2:/# gdb -q helloqt
                                        "/helloqt": not in executable format: File truncated
                                        

                                        and also when I run this:

                                        root@NanoPC-T2:/# sudo readelf -a ./helloqt | grep NEEDED
                                        readelf: Error: Reading 0x618 bytes extends past end of file for section headers
                                        readelf: Error: Section headers are not available!
                                         0x00000001 (NEEDED)
                                        

                                        Is that mean my header is wrong?
                                        this is my code:

                                        #include <QApplication>
                                        #include <QPushButton>
                                        int main(int argc, char **argv)
                                        {
                                                QApplication app (argc, argv);
                                                QPushButton button ("Hello world !");
                                                button.show();
                                                return app.exec();
                                        }
                                        

                                        H.Ghassami

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #38

                                          Looks like there is a problem with your file. How are you copying it over to your device ?

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved