g77 Compiler Error: “/usr/bin/ld: crt1.o: No such file”
38
50

I needed to do some work in Fortran, optimizing a little mathematical function. I had gcc, but apparently not g77, installed on my Debian “unstable” platform. The attempt to install g77 failed, and I didn’t have much time, so I immediately switched to my Windows/Ubuntu laptop, and booted into Ubuntu.
On the laptop, I installed g77 with not much problem. I had to repair the first install, because some files weren’t found. Running:
sudo apt-get -f install
fixed the problems and left me with what seemed to be a ready-to-use g77 compiler.
But when I tried to compile my little Fortran program, I got an error message that is apparently common on Debian platforms:
/usr/bin/ld: crt1.o: No such file: no such file or directory
A search on the internet found pages such as this lists.debian.org page on the topic Trouble with fortran compiler, which asks: “Is libc6-dev package installed?”
Good question! Apparently it wasn’t. So, I installed it with:
sudo apt-get install libc6-dev
then executed my compile statement:
g77 test.F
No error messages appeared, and an executable a.out program was produced. I had a working Fortran compiler.
Their comments
2 Responses to “g77 Compiler Error: “/usr/bin/ld: crt1.o: No such file””
1. Eder Says:
July 7th, 2006 at 6:53 pm e
thank you!! it was very useful.. I’ve just run the apt-get to libc6-dev.. and the fortran compiler started to work
2. Martin Says:
August 23rd, 2006 at 1:40 am e
Thanks for the tip that error was driving me mad all I need now is FORTRAN 90
[copied from eQuickFixes.com] () - 21 10 06 - 21:51
Same problem but with gcc on new Ubuntu Edgy, installing the libc6-dev package solved it, but required to install from cd media rather than internet repositories… strange…
thanks a lot!
Vasco () - 22 11 06 - 23:51
Had exactly the same problem on Debian Etch, with both gcc and g77, while trying to compile 3rd party code. Installing libc6-dev from net worked. Only wish did not have to spend an hour finding out it was Debian and not the 3rd party that was at fault. Thanks for the tip!
Tony () - 02 06 07 - 02:43
thanks kevin..
i did enter my regular password but it says:
‘please try again’
sharey () - 12 11 07 - 23:04
hi again..
i did all the above and got:
————————
Temporary failure resolving ‘proxyd’
Media change: please insert the disc labeled
‘Ubuntu 6.10 Edgy Eft – Release i386 (20061025)’
in the drive ‘/cdrom/’ and press enter
————————
any advice?? (please)
sharey () - 13 11 07 - 00:11
hi..
i did what u suggest and wrote :
sudo apt-get install libc6-dev
but the terminal asked about password..
what should i do??
and isnt there another way to download the libc6-dev using windows and then install it to ubuntu with out using terminal..
i hope that u help me..
regards..
sharey () - 12 11 07 - 22:43
HI
I also appreciate the solution to the /usr/bin/ld being so easy.
I was beginning to install fedora core 7 which does not have such problem.
Thanks a lot.
Jagtar () - 02 11 07 - 15:16
sharey, if your Ubuntu system is configured normally, you probably just need to enter your regular password (the one you use for logging into Ubuntu under your standard user name) when “sudo” asks you for a password.
Kevin Farnham () - 12 11 07 - 22:56

