PDA

View Full Version : ld: cannot find crt1.o



csurocket
May 20th, 2012, 04:04 PM
I'm using make to install a software, but encounter an error.

g77 mdx.o graphx_mdx.o rdf_reader_subs.o -o mdx
/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
make: *** [mdx] Error 1

I have installed g77,gcc, g++, gfortran g++-multbuild gcc-essential libc6-dev
I don't know if it's because some error in the path, like the virable FFLAGS. I'm don't know how to set them.

Thanks

Heyayun
June 9th, 2012, 02:35 PM
i have the same problem:

$ g77 helloworld.f -o helloworld
/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

i am using Kubuntu 11.10 32bit with gcc 4.6.1. I installed gcc 3.4.6 by adding the sourses:
deb http://hu.archive.Ubuntu.com/ubuntu/ hardy universe
deb http://hu.archive.Ubuntu.com/ubuntu/ hardy-updates universe

Anyone helps?

roelforg
June 10th, 2012, 03:36 PM
sudo apt-get install build-essential

Will install the packages that are missing.

Heyayun
June 11th, 2012, 06:14 AM
sudo apt-get install build-essential

Will install the packages that are missing.

I have installed the build-essential, and now it is already the newest version.

roelforg
June 11th, 2012, 08:00 AM
I have installed the build-essential, and now it is already the newest version.

Did it work?

jabl
June 11th, 2012, 10:24 AM
Try using gfortran instead of g77; using g77 is only going to get more and more difficult as it's unmaintained and the rest of the toolchain keeps evolving.

Heyayun
June 11th, 2012, 12:24 PM
Did it work?

Sorry, i didn't describe it clearly. I mean i have installed build-essential before i installed g77. Now g77 echoes errors, but gfortran works well.
My teacher uses fortran 77, so i hope g77 could work well. Any help?

jabl
June 11th, 2012, 12:33 PM
Now g77 echoes errors, but gfortran works well.
My teacher uses fortran 77, so i hope g77 could work well. Any help?

GFortran supports Fortran 77 as well, thus limiting yourself to Fortran 77 (which I think is a very bad idea in general, but YMMV) does not prevent you from using GFortran to compile your code.

Heyayun
June 11th, 2012, 01:11 PM
GFortran supports Fortran 77 as well, thus limiting yourself to Fortran 77 (which I think is a very bad idea in general, but YMMV) does not prevent you from using GFortran to compile your code.

I think gfortran is much more flexible than g77, maybe i should learn both.