Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want a workin g77 compiler on my Ubuntu 12.04 64 bit laptop. so did the following:

  1. I change the sources.list by adding the following lines:

deb hardy universe
deb-src ..// hardy universe
deb hardy-updates universe
deb-src ..// hardy-updates universe

2. then I on a terminal i did the following:

sudo apt-get update
sudo apt-get install g77

Things looked very nice then. But when I tried to compile with g77 on my Fortran77 program. I got the following errors:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

3. Why doesn't the g77 work properly. Many people need g77 why cannot Ubuntu offer a workable g77?

4. Please Help me ! Thanks from a ubuntu-beginner

share|improve this question

I had the same problem, with SAME SYSTEM today and SOLVED. It may serve for you.

If you are an expert, you can jump to the end for a 3 line solution or follow my way,

that was:
$ locate crt1.o

As I'm using x86_64, just copied "/usr/lib/x86_64-linux-gnu/"

$ locate crti.o

It was the same as above, so, nothing new.

$ locate lgcc_s


But, I tried:

$ locate gcc_s

Now, I just choose the older version, 4.4, so just copied "/usr/lib/gcc/x86_64-linux-gnu/4.4/"

The software in question was in a makefile. Openned the one and changed:

(from) FFLAGS=-g -O2

(to) FFLAGS=-g -O2 -B/usr/lib/x86_64-linux-gnu/ -B/usr/lib/gcc/x86_64-linux-gnu/4.4/

To be simple: I just add -B for each path I copied

If you are using the g77 direct in terminal, may be:

$ g77 (...) -B/usr/lib/x86_64-linux-gnu/ -B/usr/lib/gcc/x86_64-linux-gnu/4.4/ (...)


1) Use the locate to find the path of crt1.o, crti.o and-lgcc_s (search for gcc_s);
2) Copy the paths for your distro/bits;
3) Add a "-B path_1" "-B path_2" (where path_i are the paths above) in your g77 compile call.

In my case, the software is VERY old and fort77, gfortran and f77 gave tons of problems. I first successfully compiled with ifort (Intel Fortran compiler). But I tried g77 for an opensource alternative. And it works!

share|improve this answer

Try installing fort77 (sudo apt-get install fort77) which also installs f2c. Use f77 which invokes f2c translator to compile/link. Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.