quick question about linking Fortran and C



Hello,

The gist of my problem is that when I compile testc.c

int
MAIN__( int argc, char* argv[] )
{printf("argc is %i", argc);
return(0);}

with icc -c testc.c

and link with
ifort -o test testc.o
I get garbage for argc and a bad address for argv. This works fine
with gfortran, but g77 and ifort both give problems.

Any advice is appreciated; many thanks in advance.

.



Relevant Pages

  • Re: quick question about linking Fortran and C
    ... The gist of my problem is that when I compile testc.c ... I get garbage for argc and a bad address for argv. ... but g77 and ifort both give problems. ... As for icc/g77, I think you need to tell icc to produce ...
    (comp.lang.fortran)
  • Re: quick question about linking Fortran and C
    ... with icc -c testc.c ... I get garbage for argc and a bad address for argv. ... but g77 and ifort both give problems. ... of linking the various language dependent libraries. ...
    (comp.lang.fortran)
  • Re: quick question about linking Fortran and C
    ... I get garbage for argc and a bad address for argv. ... but g77 and ifort both give problems. ... Vendors Fortran manuals typically have a section near the end on mixed ... of linking the various language dependent libraries. ...
    (comp.lang.fortran)
  • Re: quick question about linking Fortran and C
    ... the linking stage -- it doesn't help. ... I get garbage for argc and a bad address for argv. ... but g77 and ifort both give problems. ... Fortran program. ...
    (comp.lang.fortran)
  • Re: C File I/O... working with array structures
    ... I've sent you an e-mail of my code and supporting information. ... bio1.c:53: warning: double format, ... but acids.count has type int. ... use, a parameter called argc. ...
    (comp.lang.c)