Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. :-1: error: collect2: fatal error: cannot find 'ld'
Forum Updated to NodeBB v4.3 + New Features

:-1: error: collect2: fatal error: cannot find 'ld'

Scheduled Pinned Locked Moved Unsolved General and Desktop
34 Posts 8 Posters 10.1k Views 2 Watching
  • 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.
  • S sude
    31 Mar 2022, 12:27

    @jsulm Yes

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 31 Mar 2022, 12:40 last edited by
    #5

    @sude Are you cross compiling?
    You should really provide more information about your setup.

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

    S 1 Reply Last reply 31 Mar 2022, 13:10
    1
    • J JonB
      31 Mar 2022, 12:37

      @sude
      In a terminal what does which ld report?

      S Offline
      S Offline
      sude
      wrote on 31 Mar 2022, 12:54 last edited by
      #6

      @JonB I can not understand, there is no ld folder.

      C J 2 Replies Last reply 31 Mar 2022, 12:57
      0
      • S sude
        31 Mar 2022, 12:54

        @JonB I can not understand, there is no ld folder.

        C Online
        C Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 31 Mar 2022, 12:57 last edited by
        #7

        @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

        there is no ld folder.

        ld is not a folder but an executable used to link your program. And you don't have installed it - install it with your package manager.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • J jsulm
          31 Mar 2022, 12:40

          @sude Are you cross compiling?
          You should really provide more information about your setup.

          S Offline
          S Offline
          sude
          wrote on 31 Mar 2022, 13:10 last edited by
          #8

          @jsulm Actually I did not use cross compile and my program features like that.

          6086cf1a-3da1-4d07-a5ca-15002f50d9f2-image.png

          A 1 Reply Last reply 5 Apr 2022, 06:56
          0
          • S sude
            31 Mar 2022, 12:54

            @JonB I can not understand, there is no ld folder.

            J Offline
            J Offline
            JonB
            wrote on 31 Mar 2022, 13:10 last edited by JonB
            #9

            @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

            @JonB I can not understand, there is no ld folder.

            @JonB said in :-1: error: collect2: fatal error: cannot find 'ld':

            @sude
            In a terminal what does which ld report?

            You just had to run that command and show its output.
            Anyway if as @Christian-Ehrlicher says you don't have the necessary package installed then that is what you need to address.

            S 1 Reply Last reply 31 Mar 2022, 13:26
            0
            • J JonB
              31 Mar 2022, 13:10

              @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

              @JonB I can not understand, there is no ld folder.

              @JonB said in :-1: error: collect2: fatal error: cannot find 'ld':

              @sude
              In a terminal what does which ld report?

              You just had to run that command and show its output.
              Anyway if as @Christian-Ehrlicher says you don't have the necessary package installed then that is what you need to address.

              S Offline
              S Offline
              sude
              wrote on 31 Mar 2022, 13:26 last edited by
              #10

              @JonB I installed but still there is an error.

              C J 2 Replies Last reply 31 Mar 2022, 13:28
              0
              • S sude
                31 Mar 2022, 13:26

                @JonB I installed but still there is an error.

                C Online
                C Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 31 Mar 2022, 13:28 last edited by
                #11

                @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

                I installed but still there is an error.

                @JonB said in :-1: error: collect2: fatal error: cannot find 'ld':

                @sude
                In a terminal what does 'which ld' report?

                Now the third request to execute this command...

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0
                • S sude
                  31 Mar 2022, 13:26

                  @JonB I installed but still there is an error.

                  J Offline
                  J Offline
                  JonB
                  wrote on 31 Mar 2022, 13:34 last edited by
                  #12

                  @sude
                  After you have run the which ld and reported its output.

                  You have not said what OS you are running on, which would help for this question. Assuming you are Ubuntu or something which works similarly, please run this command:

                  locate --regex '/ld$'
                  

                  and show us its output.

                  S 1 Reply Last reply 31 Mar 2022, 13:48
                  0
                  • J JonB
                    31 Mar 2022, 13:34

                    @sude
                    After you have run the which ld and reported its output.

                    You have not said what OS you are running on, which would help for this question. Assuming you are Ubuntu or something which works similarly, please run this command:

                    locate --regex '/ld$'
                    

                    and show us its output.

                    S Offline
                    S Offline
                    sude
                    wrote on 31 Mar 2022, 13:48 last edited by
                    #13

                    @JonB I have rasbian but i can't see anyting about it as you can see.
                    e82a652f-d3be-4b96-ad29-318dede8c854-image.png

                    K 1 Reply Last reply 31 Mar 2022, 13:55
                    0
                    • S sude
                      31 Mar 2022, 13:48

                      @JonB I have rasbian but i can't see anyting about it as you can see.
                      e82a652f-d3be-4b96-ad29-318dede8c854-image.png

                      K Offline
                      K Offline
                      KroMignon
                      wrote on 31 Mar 2022, 13:55 last edited by KroMignon
                      #14

                      @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

                      I have rasbian but i can't see anyting about it as you can see.

                      Maybe a silly question, but did you install build essential package?

                      sudo apt install -y build-essential
                      

                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                      S 1 Reply Last reply 31 Mar 2022, 14:25
                      0
                      • K KroMignon
                        31 Mar 2022, 13:55

                        @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

                        I have rasbian but i can't see anyting about it as you can see.

                        Maybe a silly question, but did you install build essential package?

                        sudo apt install -y build-essential
                        
                        S Offline
                        S Offline
                        sude
                        wrote on 31 Mar 2022, 14:25 last edited by
                        #15

                        @KroMignon Yes i did :(
                        b8e0b3bf-62e9-44fe-bcde-5d6e15f9bfb8-image.png

                        K 1 Reply Last reply 31 Mar 2022, 14:29
                        0
                        • S sude
                          31 Mar 2022, 14:25

                          @KroMignon Yes i did :(
                          b8e0b3bf-62e9-44fe-bcde-5d6e15f9bfb8-image.png

                          K Offline
                          K Offline
                          KroMignon
                          wrote on 31 Mar 2022, 14:29 last edited by
                          #16

                          @sude Just to be sure to understand what's going wrong: do you using your RaspberryPI to build or do you build a PC?

                          Is Qt Creator running on RaspberryPI or on PC?

                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                          S 1 Reply Last reply 31 Mar 2022, 14:43
                          0
                          • K KroMignon
                            31 Mar 2022, 14:29

                            @sude Just to be sure to understand what's going wrong: do you using your RaspberryPI to build or do you build a PC?

                            Is Qt Creator running on RaspberryPI or on PC?

                            S Offline
                            S Offline
                            sude
                            wrote on 31 Mar 2022, 14:43 last edited by
                            #17

                            @KroMignon It is rasbian and i am using raspberry pi 3 and i use qt creator in raspberry.

                            J 1 Reply Last reply 31 Mar 2022, 14:55
                            0
                            • S sude
                              31 Mar 2022, 14:43

                              @KroMignon It is rasbian and i am using raspberry pi 3 and i use qt creator in raspberry.

                              J Offline
                              J Offline
                              JonB
                              wrote on 31 Mar 2022, 14:55 last edited by JonB
                              #18

                              @sude
                              Since your RPi does not have the locate command I suggested earlier, now try:

                              find / -name ld -print 2>/dev/null
                              

                              and show the output (better if you copy & paste the command run plus the output as text than show screen shots).

                              S 1 Reply Last reply 1 Apr 2022, 07:43
                              0
                              • J JonB
                                31 Mar 2022, 14:55

                                @sude
                                Since your RPi does not have the locate command I suggested earlier, now try:

                                find / -name ld -print 2>/dev/null
                                

                                and show the output (better if you copy & paste the command run plus the output as text than show screen shots).

                                S Offline
                                S Offline
                                sude
                                wrote on 1 Apr 2022, 07:43 last edited by
                                #19

                                @JonB

                                pi@raspberrypi:~ $ which ld
                                pi@raspberrypi:~ $ find / -name ld -print 2>/dev/null
                                /usr/bin/ld
                                /usr/lib/compat-ld/ld
                                /usr/lib/gold-ld/ld
                                /usr/share/doc/binutils/ld
                                pi@raspberrypi:~ $

                                My terminal output is like that.

                                J 1 Reply Last reply 1 Apr 2022, 08:04
                                0
                                • S sude
                                  1 Apr 2022, 07:43

                                  @JonB

                                  pi@raspberrypi:~ $ which ld
                                  pi@raspberrypi:~ $ find / -name ld -print 2>/dev/null
                                  /usr/bin/ld
                                  /usr/lib/compat-ld/ld
                                  /usr/lib/gold-ld/ld
                                  /usr/share/doc/binutils/ld
                                  pi@raspberrypi:~ $

                                  My terminal output is like that.

                                  J Offline
                                  J Offline
                                  JonB
                                  wrote on 1 Apr 2022, 08:04 last edited by
                                  #20

                                  @sude
                                  OK, hold on, that is strange.

                                  which ld shows no ld executable on your PATH.

                                  But the find shows /usr/bin/ld. That should be both executable and on your PATH.

                                  • Output from ls -l /usr/bin/ld?
                                  • Output from echo $PATH?
                                  S 1 Reply Last reply 1 Apr 2022, 08:10
                                  0
                                  • J JonB
                                    1 Apr 2022, 08:04

                                    @sude
                                    OK, hold on, that is strange.

                                    which ld shows no ld executable on your PATH.

                                    But the find shows /usr/bin/ld. That should be both executable and on your PATH.

                                    • Output from ls -l /usr/bin/ld?
                                    • Output from echo $PATH?
                                    S Offline
                                    S Offline
                                    sude
                                    wrote on 1 Apr 2022, 08:10 last edited by
                                    #21

                                    @JonB
                                    pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                    toplam 0

                                    It is zero how can i echo :(

                                    J 2 Replies Last reply 1 Apr 2022, 08:16
                                    0
                                    • S sude
                                      1 Apr 2022, 08:10

                                      @JonB
                                      pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                      toplam 0

                                      It is zero how can i echo :(

                                      J Offline
                                      J Offline
                                      JonB
                                      wrote on 1 Apr 2022, 08:16 last edited by
                                      #22

                                      @sude

                                      pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                      toplam 0
                                      

                                      I don't understand. The output should look something like mine under Ubuntu:

                                      ls -l /usr/bin/ld
                                      lrwxrwxrwx 1 root root 19 Oct 20 12:09 /usr/bin/ld -> x86_64-linux-gnu-ld
                                      

                                      Since it's a soft link on mine and may be on yours, now try:

                                      ls -lL /usr/bin/ld
                                      -rwxr-xr-x 1 root root 1740384 Oct 20 12:09 /usr/bin/ld
                                      

                                      on yours, please?

                                      It is zero how can i echo :(

                                      What is zero? On mine:

                                      echo $PATH
                                      /home/jon/.local/bin:/home/jon/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
                                      
                                      1 Reply Last reply
                                      0
                                      • S sude
                                        1 Apr 2022, 08:10

                                        @JonB
                                        pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                        toplam 0

                                        It is zero how can i echo :(

                                        J Offline
                                        J Offline
                                        JonB
                                        wrote on 1 Apr 2022, 08:26 last edited by JonB 4 Jan 2022, 08:30
                                        #23

                                        @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

                                        pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                        toplam 0

                                        Ah, hang on, that is indeed what you get if /usr/bin/ls is an (empty) directory:

                                        mkdir empty
                                        ls -l empty
                                        total 0
                                        

                                        Maybe toplam means total in your language?!

                                        OK, that is indeed strange. /usr/bin/ld should be, or be a soft link to, an executable file, not a directory!

                                        Go back to the find command. Assuming RPi find accepts -ls, try:

                                        find / -name ld -ls 2>/dev/null
                                        

                                        If not try:

                                        ls -ld `find / -name ld -print 2>/dev/null`
                                        

                                        Note those two ` ("backtick") characters, you will have to find that on your keyboard.

                                        S 1 Reply Last reply 1 Apr 2022, 08:39
                                        0
                                        • J JonB
                                          1 Apr 2022, 08:26

                                          @sude said in :-1: error: collect2: fatal error: cannot find 'ld':

                                          pi@raspberrypi:~ $ ls -l /usr/bin/ld
                                          toplam 0

                                          Ah, hang on, that is indeed what you get if /usr/bin/ls is an (empty) directory:

                                          mkdir empty
                                          ls -l empty
                                          total 0
                                          

                                          Maybe toplam means total in your language?!

                                          OK, that is indeed strange. /usr/bin/ld should be, or be a soft link to, an executable file, not a directory!

                                          Go back to the find command. Assuming RPi find accepts -ls, try:

                                          find / -name ld -ls 2>/dev/null
                                          

                                          If not try:

                                          ls -ld `find / -name ld -print 2>/dev/null`
                                          

                                          Note those two ` ("backtick") characters, you will have to find that on your keyboard.

                                          S Offline
                                          S Offline
                                          sude
                                          wrote on 1 Apr 2022, 08:39 last edited by
                                          #24

                                          @JonB
                                          pi@raspberrypi:~ $ find / -name ld -ls 2>/dev/null
                                          300053 0 lrwxrwxrwx 1 root root 16 Şub 6 2020 /usr/lib/compat-ld/ld -> ../../bin/ld.bfd
                                          300055 0 lrwxrwxrwx 1 root root 17 Şub 6 2020 /usr/lib/gold-ld/ld -> ../../bin/ld.gold
                                          299210 4 drwxr-xr-x 2 root root 4096 Mar 5 2021 /usr/share/doc/binutils/ld
                                          pi@raspberrypi:~ $ ls -ld find / -name ld -print 2>/dev/null
                                          lrwxrwxrwx 1 root root 16 Şub 6 2020 /usr/lib/compat-ld/ld -> ../../bin/ld.bfd
                                          lrwxrwxrwx 1 root root 17 Şub 6 2020 /usr/lib/gold-ld/ld -> ../../bin/ld.gold
                                          drwxr-xr-x 2 root root 4096 Mar 5 2021 /usr/share/doc/binutils/ld
                                          pi@raspberrypi:~ $

                                          J 1 Reply Last reply 1 Apr 2022, 08:53
                                          0

                                          14/34

                                          31 Mar 2022, 13:55

                                          • Login

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