LINUX.ORG.RU

collect2: cannot find 'ld'

 , , , ,


0

1

Could somebody have met this problem, I have collect2: cannot find 'ld' error when try:

 gcc -pthread -I /tmp/usr/include -no-use-gold-linker /tmp/teeest.c -o /tmp/teeest > /tmp/ok.log 2>/tmp/error.log 

Result:

 collect2: cannot find 'ld'

Check ld existing:

ld: /usr/bin/ld /usr/share/man/man1/ld.1.gz

Check $PATH

/usr/local/bin:/bin:/usr/bin

I try to compile hello world application on C in /tmp dir. CentOS 6, 2016, 2.6.32-642.1.1.el6.x86_64, x86_64

What ‘which ld’ and `find / -type f -name ld` says? It's look for me as either you don't have this program, or you should configure your PATH

XMs ★★★★★
()

- Какой курс?
- 6000
(с)

mos ★★☆☆☆
()
Ответ на: комментарий от XMs
ld: /usr/bin/ld /usr/share/man/man1/ld.1.gz

This is a `whereis` output, so ld is definitely in PATH.

jenpayout,
However, it might be that /usr/bin/ld is not executable* (or fails to start). Try invoking it manually and see if it works:

file /usr/bin/ld
stat $(readlink -e /usr/bin/ld)
ld --help

* E.g. it might be a broken symlink or incorrect access rights

KennyMinigun ★★★★★
()
Последнее исправление: KennyMinigun (всего исправлений: 3)
Ответ на: комментарий от KennyMinigun

ld: /usr/bin/ld /usr/share/man/man1/ld.1.gz

My bad, I haven't noticed it

XMs ★★★★★
()

Sup faggots, what's going on in this thread?

anonymous
()

gcc -no-use-gold-linker

Что за флаг? Сам придумал или кто-то подсказал?

gcc -fuse-ld=bfd

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.