Symbol referencing errors building hello world, sparc-sun-solaris2.11, gfortran-4.1.0
Tim Prince
tprince@myrealbox.com
Tue Mar 7 15:32:00 GMT 2006
John Wiggins wrote:
> I'm running into some problems compiling a simple hello world:
>
> c
> c Hello, world.
> c
> Program Hello
>
> implicit none
> logical DONE
>
> DO while (.NOT. DONE)
> write(*,10)
> END DO
> 10 format('Hello, world.')
> END
>
>
> % gfortran test.f
> Undefined first referenced
> symbol in file
> _gfortrani_internal_pack_c4
> /usr/local/lib/gcc/sparc-sun-solaris2.11/4.1.0/../../../libgfortran.so
> _gfortrani_internal_pack_c8
> /usr/local/lib/gcc/sparc-sun-solaris2.11/4.1.0/../../../libgfortran.so
> _gfortrani_internal_unpack_c4
> /usr/local/lib/gcc/sparc-sun-solaris2.11/4.1.0/../../../libgfortran.so
> _gfortrani_internal_unpack_c8
> /usr/local/lib/gcc/sparc-sun-solaris2.11/4.1.0/../../../libgfortran.so
> ld: fatal: Symbol referencing errors. No output written to a.out
> collect2: ld returned 1 exit status
>
> $ gfortran -v
> Using built-in specs.
> Target: sparc-sun-solaris2.11
> Configured with: /d0/builds/gcc-4.1.0/configure --without-gnu-as
> --with-as=/usr/ccs/bin/as --without-gnu-ld --with-ld=/usr/ccs/bin/ld
> --enable-threads=posix --with-local-prefix=/usr/local --enable-shared
> --enable-multilib --enable-nls --with-included-gettext --with-x
> --enable-java-awt=xlib --with-mpfr=/usr/local --with-gmp=/usr/local
> --enable-languages=c,c++,objc,ada,fortran
> Thread model: posix
> gcc version 4.1.0
>
> Any help would be greatly appreciated.
>
You might run 'ldd a.out' and see whether you are picking up the shared
libraries which should have been installed with this version of gcc. On
many systems, LD_LIBRARY_PATH has to be set to accomplish this.
More information about the Fortran
mailing list