newbie gfortran question
Kamaraju Kusumanchi
kk288@cornell.edu
Sun Jun 19 00:42:00 GMT 2005
Jeff Tibbitt wrote:
>Hi,
>
>I recently downloaded the gfortran compiler for my new
>ibook with OSX 10.3.5
>
>I tried compiling a simple fortran program named hello.f90
>
>
>
>The command I issued was:
>
>gfortran -o a.out hello.f90
>
>
>
>The error I get is:
>
>Claws-Computer:~/test/practice Claw$ gfortran -o a.out
>hello.f90
>/usr/bin/ld: can't locate file for: -lcrt1.o
>collect2: ld returned 1 exit status
>
>
This is linker error. You need to make sure that libctrl.o is in your path.
A simple solution is to use the -static option and see if it works.
gfortran -static hello.f90 -o a.out
>When I compile using the -c flag to produce an object file,
>it works. Then when I try to make the executable the same
>error happens.
>
>
-c option just compiles it to object file. Where as producing executable
involves linking the object files.
>Im pretty new at fortran and Mac, and could really use a
>suggestion.
>
>
In the future, you might get a better/quicker help if you post questions
related to gfortran on their mailing list fortran@gcc.gnu.org (google
for instructions on how to subscribe to it) instead of gcc-help.
raju
--
Kamaraju S Kusumanchi
Graduate Student, MAE
Cornell University
http://www.people.cornell.edu/pages/kk288/
More information about the Gcc-help
mailing list