undefined reference to `__ctype_b with pgf90 5.2-4

I am currently running RedHat Linux 9.0 with pgf90 pgf90 5.2-4. A user had the following error while copiling:

./HDF_lib/libmfhdf.a(error.o)(.text+0x2d): In function strerror': : sys_errlist’ is deprecated; use strerror' or strerror_r’ instead
./HDF_lib/libmfhdf.a(error.o)(.text+0xe): In function strerror': : sys_nerr’ is deprecated; use strerror' or strerror_r’ instead
./HDF_lib/libdf.a(hkit.o)(.text+0x66): In function HDf2cstring': : undefined reference to __ctype_b’
pgf90-Fatal-linker completed with exit code 1

Is there a work around or a fix for this problem. Any feedback would be greatly appricated.

Hi Jonatas,

We do have a FAQ about the “__ctype_b” link error here. Some linux distributions use the more current symbol “__ctype_b_loc” while others use the older “__ctype_b” symbol. The mfhdf library was most likely built on a different system that uses “__ctype_b” instead of “__ctype_b_loc” as your Red Hat 9.0 distribution expects. Please try the work around stated in the FAQ. However if the source is available, your best option would be to recompile the library on the Red Hat 9.0.

  • Mat

In the FAQ the code for the ctype_wa.c is correct except the #include line is left without an argument. It should read

#include <ctype.h>

Thanks for pointing this out. “<ctype.h>” is actually there but the person who wrote this forgot to change it to “<ctype.h>” so that the “<>” is not seen as a tag by the browser. I’ve passed this along and it should be fixed shortly.

  • Mat