From: neal@trieste.stat.washington.edu (Phil Neal)
Subject: Mixed language programming
Date: 1 Aug 1994 22:35:16 GMT [thread overview]
Message-ID: <31jtb4$f1a@news.u.washington.edu> (raw)
Dear osf1/alpha people,
I have been having a problem trying to make a program with
a C main and a f77 subroutine. I have been through the man
pages and the dxbook stuff for f77. It gives examples for
f77 calling C but never C calling f77. Any pointers would
be extremely appreciated (no pun intended).
Here is the main:
extern testit_();
main()
{
testit_();
printf(" back again \n");
}
And here is the subroutine:
subroutine testit()
write(*,*) ' in testit'
return
end
Here is the make file:
test.exe: test.o testit.o
f77 -v test.o testit.o -o test.exe
clean:
rm *.o *.exe
Here is the error message:
_trieste_215% make
cc -c test.c
f77 -c testit.f
f77 -v test.o testit.o -o test.exe
/usr/bin/cc -v -o test.exe /usr/lib/cmplrs/fort/for_main.o -O4
test.o testit.o -nocount -lUfor -lfor -lFutil -lm -lots
/usr/lib/cmplrs/cc/ld -o test.exe -g0 -O4 -call_shared
/usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/fort/for_main.o test.o
testit.o -nocount -lUfor -lfor -lFutil -lm -lots -lc
ld:
test.o: main: multiply defined
Unresolved:
MAIN__
0.0u 0.0s 0:00 60% 0+8k 3+5io 22pf+0w
fort: Severe: Failed while trying to link.
*** Exit 1
Stop.
Phil
----------------------------------------------------------------
Phil Neal, Systems Programmer, Statistics Department GN-22
University of Washington, Seattle, Wa. 98195 USA | 206-685-1627
http://www.stat.washington.edu/phil.html
----------------------------------------------------------------
Those who would repeat the past must control the teaching of history.
(Bene Gesserit Coda)
next reply other threads:[~1994-08-01 22:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-08-01 22:35 Phil Neal [this message]
1994-08-02 6:59 ` Mixed language programming system PRIVILEGED account
1994-08-02 14:02 ` Alexander Kovzelev
-- strict thread matches above, loose matches on Subject: below --
1994-08-01 14:37 Phil Neal
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox