Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IargC,getarg

Status
Not open for further replies.

Sethuraman

Programmer
Joined
Apr 5, 2005
Messages
3
Location
DE
Can you help me in using the functions like IargC, Getarg to read the arguments while running a.out file, I have tried it after seeing an example from the forum, but it didnt work for me...........
The error message is........... "Iargc or Getarg are unknown intrinsic function".

Example prgrm: program main
character*40 arg
integer i
intrinsic getarg
do 10 i = 1, 10, 1
call getarg (i, arg)
! check for the last parameter
if (arg(1:1) .eq. ' ') goto 20
print *, 'Arg ', i, ' = ', arg
10 continue
20 continue
stop
end
Please kindly help me in solving it.
 
Which compiler/OS are you using?
 
getarg is not an intrinsic. Just remove the intrinsic declaration and it will work.
 
Hi thanks for Your suggestion, but still I see the problem.

for example if I combine this program........

Program get
character argv*10
integer i, iargc, m
m = iargc()
do i = 1, m
call getarg ( i, argv )
write( *, '( i2, 1x, a )' ) i, argv
end do
end


I am getting no a.out file, instead i am getting an error message like this......
/tmp/ifcVxYQhY.o(.text+0x1f): In function `main':
: undefined reference to `iargc_'
/tmp/ifcVxYQhY.o(.text+0x49): In function `main':
: undefined reference to `getarg_'


could you please help me in finding the solution?


 
Check your LD_LIBRARY_PATH setting. Is it pointing to where the libraries are installed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top