[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Error Fortran Message



> 
> 
> Dear Sir:
>    I installed debian software for linux in my machine and it's ok. when
> I try to install gcc_2.7.2.1-8 with g77=0.5.20-1.deb also it's ok. For compile
> Fortran program contain only main program, g77 or f77 command can compile and
> I get the execute file for this program. But when I try to compile subroutine
> ex. aa.f to get the execute file aa.o by the command f77 aa.f or g77 aa.f I
> get error message which is {/usr/lib/gcc-lib/i486-linux/2.7.2.1/libf2c(main.o):
> in function "main": main.o(.text+ox154): undefined reference to "MAIN_"}. At
> the same time I can't execute any program contain subroutine. could you
> please tell me how can I solve this problem.

To compile a file into an object file, (.o file) you should use the -c
option:

g77 -c aa.f

Then to get an executable, take all your object files and link them:

g77 -o myprogram aa.o bb.o ....

This will give you the executable `myprogram'.  I would advise you to
install the info debian package and to read the sections on g77 (type
info g77).

Eric Meijer

-- 
 E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: