bug? runtime error passing POD
Daniel Franke
daniel.franke@imbs.uni-luebeck.de
Mon Jul 4 19:57:00 GMT 2005
> > No (explicit) static linking on my side:
> >
> > -- Makefile--
> > GCCPATH = <local-path>
> >
> > CFLAGS = -g -ansi -pedantic -W -Wall
> > FFLAGS = -g -W -Wall
> > LDFLAGS = -L$(GCCPATH)/lib -lgfortran -lm
> >
> > test.gfortran: clean f.f90 test.c
> > $(GCCPATH)/bin/gfortran $(FFLAGS) -c f.f90 -o f.o
> > $(GCCPATH)/bin/gcc $(CFLAGS) -c test.c -o test.o
> > $(GCCPATH)/bin/gcc f.o test.o $(LDFLAGS) -o test.gfortran
>
> ... you need to either add -lgfortranbegin to LDFLAGS or use gfortran
> instead of gcc as linker command.
Using gfortran to link (with or without -lgfortranbegin) doesn't change the
result:
$> gfortran -g -W -Wall -c f.f90 -o f.o
$> gcc -g -ansi -pedantic -W -Wall -c test.c -o test.o
$> gfortran f.o test.o -L<local-path>/lib -lgfortran -lm -o test.gfortran
$> ./test.gfortran
Fortran runtime error: End of record
$> gfortran -g -W -Wall -c f.f90 -o f.o
$> gcc -g -ansi -pedantic -W -Wall -c test.c -o test.o
$> f.o test.o -L<local-path>/lib -lgfortran -lgfortranbegin -lm -o
test.gfortran
$> ./test.gfortran
Fortran runtime error: End of record
More information about the Fortran
mailing list