:-1: error: collect2: fatal error: cannot find 'ld'
-
@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 doeswhich 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. -
@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...
-
@sude
After you have run thewhich 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.
-
@sude
After you have run thewhich 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.
-
@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
-
@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
@KroMignon Yes i did :(
-
@KroMignon Yes i did :(
-
@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?
@KroMignon It is rasbian and i am using raspberry pi 3 and i use qt creator in raspberry.
-
@KroMignon It is rasbian and i am using raspberry pi 3 and i use qt creator in raspberry.
-
@sude
Since your RPi does not have thelocate
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).
-
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.
-
@sude
OK, hold on, that is strange.which ld
shows nold
executable on yourPATH
.But the
find
shows/usr/bin/ld
. That should be both executable and on yourPATH
.- Output from
ls -l /usr/bin/ld
? - Output from
echo $PATH
?
- Output from
-
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
-
@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
meanstotal
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 RPifind
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
-
@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
meanstotal
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 RPifind
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
@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 -ldfind / -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:~ $ -
@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 -ldfind / -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:~ $@sude
Well, again I don't understand/am surprised at your output.Earlier your showed 4 matches for
ld
, including/usr/bin/ld
. Now you show only 3 matches, not including/usr/bin/ld
. I don't know why....Last try:
ls -ld /usr/bin/ld
?ls -lLd /usr/bin/ld
?
Assuming those show it's a directory, or even that it does not exist, it does not look to me as though your RPi has
ld
installed/properly installed. Earlier you saidsudo apt install -y build-essential
was reporting "installed", but it doesn't feel right to me. Maybe you should try uninstall and reinstall, I don't know. I believe that untilwhich ld
returns an executable file path (e.g./usr/bin/ld
) you are in a bad state. But I know nothing about RPi.... -
@sude
Well, again I don't understand/am surprised at your output.Earlier your showed 4 matches for
ld
, including/usr/bin/ld
. Now you show only 3 matches, not including/usr/bin/ld
. I don't know why....Last try:
ls -ld /usr/bin/ld
?ls -lLd /usr/bin/ld
?
Assuming those show it's a directory, or even that it does not exist, it does not look to me as though your RPi has
ld
installed/properly installed. Earlier you saidsudo apt install -y build-essential
was reporting "installed", but it doesn't feel right to me. Maybe you should try uninstall and reinstall, I don't know. I believe that untilwhich ld
returns an executable file path (e.g./usr/bin/ld
) you are in a bad state. But I know nothing about RPi.... -
Hi,
In that case you should maybe go with the nuclear option and restart from a clean installation on your RPi. As written by @JonB, if having installed build-essential does not give you all the tools, then there's likely something wrong with your system.
-
Hi,
In that case you should maybe go with the nuclear option and restart from a clean installation on your RPi. As written by @JonB, if having installed build-essential does not give you all the tools, then there's likely something wrong with your system.
-
@sude
Well, again I don't understand/am surprised at your output.Earlier your showed 4 matches for
ld
, including/usr/bin/ld
. Now you show only 3 matches, not including/usr/bin/ld
. I don't know why....Last try:
ls -ld /usr/bin/ld
?ls -lLd /usr/bin/ld
?
Assuming those show it's a directory, or even that it does not exist, it does not look to me as though your RPi has
ld
installed/properly installed. Earlier you saidsudo apt install -y build-essential
was reporting "installed", but it doesn't feel right to me. Maybe you should try uninstall and reinstall, I don't know. I believe that untilwhich ld
returns an executable file path (e.g./usr/bin/ld
) you are in a bad state. But I know nothing about RPi....@JonB said in :-1: error: collect2: fatal error: cannot find 'ld':
ls -lLd /usr/bin/ld
pi@raspberrypi:~ $ ls -ld /usr/bin/ld
ls: Could not access '/usr/bin/ld': No such file or directory
pi@raspberrypi:~ $ ls -lLd /usr/bin/ld
ls: Could not access '/usr/bin/ld': No such file or directory