using iargc()/getarg() form C

Satish Balay balay@fastmail.fm
Wed Feb 23 19:56:00 GMT 2005


On Wed, 23 Feb 2005, Steve Kargl wrote:

> Whoops.  I sent the wrong foo program.  Try this one.
> 
> program main
>   integer i, iargc
>   external iargc    ! This line is important.
>   i = iargc()
>   print *, i
> end
> 
> troutmask:kargl[220] /usr/tmp/sgk/bin/gfc -o foo -static foo.f90 
> /var/tmp/cc8VmR4v.o(.text+0x9): In function `MAIN__':
> : undefined reference to `iargc_'
> collect2: ld returned 1 exit status
> troutmask:kargl[221] /usr/tmp/sgk/bin/gfc -o foo -static foo.f90 gr.o
> troutmask:kargl[222] ./foo 1 2 3
>            3
> troutmask:kargl[228] /usr/tmp/sgk/bin/gfc -static -c foo.f90
> troutmask:kargl[229] nm foo.o
> 0000000000000000 T MAIN__
>                  U _gfortran_filename
>                  U _gfortran_ioparm
>                  U _gfortran_line
>                  U _gfortran_st_write
>                  U _gfortran_st_write_done
>                  U _gfortran_transfer_integer
>                  U iargc_

I guess I understand this code - but this usage is not relavant to to
the stated problem. Its relavant only if the wrapper code is in
gfortran library.

thanks,
Satish



More information about the Fortran mailing list