Re: quick question about linking Fortran and C
- From: Arjen Markus <arjen.markus@xxxxxxxxxx>
- Date: Fri, 17 Aug 2007 07:01:23 -0700
On 17 aug, 15:48, otto.piv...@xxxxxxxxx wrote:
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.
The problem is that ifort assumes that the main program is a
Fortran program. That is clearly not the case here. Use the
option -no-for_main (or something similar) for the compile and
link step.
As for icc/g77, I think you need to tell icc to produce
object files suitable for use with gcc. I do not know the
option.
Regards,
Arjen
.
- Follow-Ups:
- Re: quick question about linking Fortran and C
- From: otto . pivner
- Re: quick question about linking Fortran and C
- References:
- quick question about linking Fortran and C
- From: otto . pivner
- quick question about linking Fortran and C
- Prev by Date: quick question about linking Fortran and C
- Next by Date: Re: quick question about linking Fortran and C
- Previous by thread: quick question about linking Fortran and C
- Next by thread: Re: quick question about linking Fortran and C
- Index(es):
Relevant Pages
|
|