[GRASS-dev] G7: landsat_met.c:103: undefined reference to `chrncpy'

Markus Neteler neteler at osgeo.org
Mon Jul 29 03:29:35 PDT 2013


Hi,

I changed my compiler flags to catch more potential errrors and got this one:

[neteler at north i.landsat.toar]$ make
gcc  -g -Wall -fno-common -fexceptions -std=gnu99
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -m64
-mtune=generic
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/landsat_met.o -c landsat_met.c
In file included from /usr/include/stdio.h:27:0,
                 from landsat_met.c:1:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]
: && gcc -L/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
-L/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
-Wl,--export-dynamic  -L/usr/lib64
-Wl,-rpath-link,/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
 -o /home/neteler/grass70/dist.x86_64-unknown-linux-gnu/bin/i.landsat.toar
OBJ.x86_64-unknown-linux-gnu/landsat_set.o
OBJ.x86_64-unknown-linux-gnu/main.o
OBJ.x86_64-unknown-linux-gnu/landsat.o
OBJ.x86_64-unknown-linux-gnu/earth_sun.o
OBJ.x86_64-unknown-linux-gnu/landsat_met.o    -lgrass_raster.7.0.svn
-lgrass_gis.7.0.svn  -lm
OBJ.x86_64-unknown-linux-gnu/landsat_met.o: In function `lsat_metadata':
/home/neteler/grass70/imagery/i.landsat.toar/landsat_met.c:103:
undefined reference to `chrncpy'
/home/neteler/grass70/imagery/i.landsat.toar/landsat_met.c:112:
undefined reference to `chrncpy'
/home/neteler/grass70/imagery/i.landsat.toar/landsat_met.c:122:
undefined reference to `chrncpy'
collect2: error: ld returned 1 exit status
make: *** [/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/bin/i.landsat.toar]
Error 1

Does anyone know how to fix that? Perhaps related to the use of
-D_FORTIFY_SOURCE=2

Markus


More information about the grass-dev mailing list