[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined ref to __ctype_b (fwd)



------- Forwarded Message

Date:    Tue, 13 Apr 2004 14:26:28 -0600
From:    Russ Rew <address@hidden>
To:      Ben Foster <address@hidden>
Subject: Re: undefined ref to __ctype_b 

>To: address@hidden
>From: Ben Foster <address@hidden>
>Subject: Re: 20040413: undefined ref to __ctype_b
>Organization: NCAR/HAO
>Keywords: 200404132011.i3DKBdCT009593

Hi Ben,

> I am compiling an f90 code that links libnetcdf.a -- the source files
> compile fine using pgf90, but I get the following problem when linking:
> 
> 
> /opt/local/lib/libnetcdf.a(string.o)(.text+0x37): In function `NC_check_name':
> : undefined reference to `__ctype_b'
> gmake: *** [tiegcm1] Error 2
> (suncat) tiegcm : 
> 
> 
> This is on the following Linux system:
> 
> (suncat) include : uname -a
> Linux suncat 2.4.20-30.9smp #1 SMP Wed Feb 4 20:36:46 EST 2004 i686 i686 i386 
> GNU/Linux
> 
> This system does have a ctype.h in /usr/include, which has __ctype_b as 
> follows:
> 
> (suncat) include : pwd
> /usr/include
> (suncat) include : fgrep __ctype_b ctype.h
> extern __const unsigned short int **__ctype_b_loc (void)
>   ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type)
>   ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
> (suncat) include :
> 
> BTW, I am using the following in the Makefile:
> 
>  FC = pgf90
>  FFLAGS = -I/opt/local/include -Msecond_underscore
>  LIBS = -L/opt/local/lib -lnetcdf
>  LDFLAGS =

I think the problem is that you just copied a libnetcdf.a built on a
RedHat 8 system to a RedHat 9 system.  Instead, I think you have to
recompile and install the library from source for RedHat 9.  See these
previous support responses:

  
http://www.unidata.ucar.edu/cgi-bin/aglimpse/70?query=__ctype_b&case=on&errors=0&maxfiles=10

--Russ

------- End of Forwarded Message