I'm going through the tutorial on making an OS on http://wiki.osdev.org/Bare_Bones. When I try to link boot.o and kernel.o using this command: i686-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc , I just get this error:
collect2: fatal error: cannot find 'ld'
compilation terminated.
I just installed fresh Ubuntu 15.10 that with gcc-5.2.1 and binutils-2.25.1 . I have searched the internet for answers but nothing helped.
I also got once the same error during a pentest while I was trying to compile my exploit on the victim server.
In my case, the directory where the "ld" program was located had not been defined in the PATH environment variable, so I simply added it.
eg. export PATH=$PATH:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With