It's my second post here, i have a huge problem which prevents me to study so i have to fix it as soon as it's possible !
My gcc was working fine and i had to work on FairThreads (in C). I downloaded the following archive :
As you can see, in /src there's a makeFile, i replaced the second line which was :
LIB_DIR = ../lib
by
LIB_DIR = /usr/bin/ld
and i compiled the makeFile by the command "make"
And now, i cannot compile any c/c++ program anymore. Even a hello world program.
I got the following error message on the terminal for every compiling attempt :
/usr/bin/ld: 2: /usr/bin/ld: Syntax error: newline unexpected
collect2: error: ld returned 2 exit status
I have found on the net this solution but it doesn't work for me :
sudo apt-get autoremove binutils
sudo apt-get install binutils
I also tried to reinstall gcc, when executing :
sudo apt-get purge gcc
i got :
Des erreurs ont été rencontrées pendant l'exécution :
linux-firmware
linux-image-generic-hwe-18.04
linux-generic-hwe-18.04
E: Sub-process /usr/bin/dpkg returned an error code (1)
but when i trie a gcc --version it tells me that it is not found.
So when i execute the command to reintall it :
sudo apt-get install gcc
i also get :
Des erreurs ont été rencontrées pendant l'exécution :
linux-firmware
linux-image-generic-hwe-18.04
linux-generic-hwe-18.04
linux-image-5.4.0-72-generic
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
but gcc --version tellls that it's installed.
Finally, when i trie to compile a program, i got :
/usr/bin/ld: 2: /usr/bin/ld: Syntax error: newline unexpected
collect2: error: ld returned 2 exit status
I hope that i explained well, and i'll get a solution for this :/, as a computer science student, i can't do anything without gcc :(
EDIT 1 :
When i try to remove bin/ld by executing :
sudo rm -fr /usr/bin/ld;sudo apt-get install --reinstall binutils
i got :
Des erreurs ont été rencontrées pendant l'exécution :
linux-firmware
linux-image-generic-hwe-18.04
linux-generic-hwe-18.04
linux-image-5.4.0-72-generic
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
and this particular error message :
WARNING: no ldd around - install libc-bin
EDIT :
I have installed ldd by the command :
sudo apt-get install libc-bin
still no changes...
rm -rf /usr/bin/ld/
, and reinstall ld.apt-get reinstall binutils
.ldd
. Try to follow the suggestionsudo apt-get install libc-bin
.It seems you did more than what is in the original question. It's not easy to help you recover from things we don't know about. Hope reinstallinglibc-bin
works.