Re: Error while compiling and linking

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 29 Oct 2008 08:01:21 -0600 (MDT)

Hi Samrat,

Try adding "-lgcc -lg2c" to your compile line.

This is mentioned at:

    http://www.ncl.ucar.edu/FAQ/#misc_003

When you use a different compiler than what NCAR Graphics was built
with, you usually need to include some system libraries to resolve
symbols.

Also, you may just want to edit $NCARG_ROOT/bin/ncargf77
and $NCARG_ROOT/bin/nhlf77 and change the compiler from "g77"
to "gfortran" and if the "-lgcc -lg2c" works, add these to
the "libextra" (or "extralibs") line.

--Mary

On Wed, 29 Oct 2008, Samrat Rao wrote:

> Hi,
> I have installed NCL 5.0.0 OPeNDAP-enabled binaries. I tried the command:
> $: ncargex cpex08.
> I get the error:
>
> NCAR Graphics Fortran Example <cpex08>
>
> Copying cpex08.f
>
> Copying cpexcc.f
>
> Compiling and linking...
> g77 -fPIC -fno-second-underscore -O -o cpex08 cpexcc.f cpex08.f
> -L/usr/local/ncl-ncarg_5.0.0_binary/lib -lncarg -lncarg_gks -lncarg_c -lX11
> -lXext
> g77: Command not found.
>
> The compile and link failed.
>
> I have gfortran installed in my openSUSE 11.0. So i created a symbolic
> link 'g77' to gfortran and tried reissuing the same command. But i get a
> multitude of errors:
>
> NCAR Graphics Fortran Example <cpex08>
>
> Copying cpex08.f
>
> Copying cpexcc.f
>
> Compiling and linking...
> g77 -fPIC -fno-second-underscore -O -o cpex08 cpexcc.f cpex08.f
> -L/usr/local/ncl-ncarg_5.0.0_binary/lib -lncarg -lncarg_gks -lncarg_c -lX11
> -lXext
> /usr/local/ncl-ncarg_5.0.0_binary/lib/libncarg.a(cpcldm.o): In function
> `cpcldm_':
> cpcldm.f:(.text+0x5ec): undefined reference to `s_cat'
> cpcldm.f:(.text+0xc26): undefined reference to `s_copy'
> cpcldm.f:(.text+0xc85): undefined reference to `s_copy'
> cpcldm.f:(.text+0xcda): undefined reference to `s_copy'
> cpcldm.f:(.text+0xd65): undefined reference to `s_copy'
> cpcldm.f:(.text+0xdba): undefined reference to `s_copy'
> /usr/local/ncl-ncarg_5.0.0_binary/lib/libncarg.a(cpcldm.o):cpcldm.f:(.text+0xecc):
> more undefined references to `s_copy' follow
>
> ...and so on...till finally i get:
>
> The compile and link failed.
>
> How do i go about solving the problem?
>
> Thanks!
> --
>
> Samrat Rao
> Department of Mechanical Engineering
> Indian Institute of Science
> Bangalore - 560012, India
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 29 2008 - 08:01:21 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 29 2008 - 09:22:41 MDT