[GRASS-dev] lots of link errors in trunk (OSX)

Glynn Clements glynn at gclements.plus.com
Fri Aug 28 10:15:17 EDT 2009

William Kyngesburye wrote:

> I'm getting a lot of link errors in trunk now.  It looks like it might  
> be related to r38871 and r38893 where all the *DEP and *LIB variables  
> were changed.

That's quite likely.

> It's a very long list, but errors are all similar to:
> in cluster:
> cc ... -lgrass_imagery -lgrass_gis
> Undefined symbols:
>    "_Rast_is_d_null_value", referenced from:
>        _I_cluster_point_part in c_point.o
>        _I_cluster_point in c_point.o

Okay; that makes sense.

For this particular error, the splitting off of the raster functions
into lib/raster was probably a factor.

> or in rowio:
> cc ... [no link libs at all]
> Undefined symbols:
>    "_G_warning", referenced from:
>        _Rowio_setup in setup.o
>    "_G__malloc", referenced from:
>        _Rowio_setup in setup.o
>        _Rowio_setup in setup.o

Many libraries omitted $(GISLIB) from their dependencies as it would
always end up being added in the module's Makefile.

> or in g.proj:
> gcc ... -lproj  -lgrass_gproj -lgrass_gis
> Undefined symbols:
>    "_OGR_L_GetExtent", referenced from:
>        _input_georef in input.o
>    "_OSRImportFromProj4", referenced from:
>        _input_proj4 in input.o
>    "_GDALGetRasterXSize", referenced from:
>        _input_georef in input.o
> ...

g.proj/Makefile needs $(GDALLIBS) as g.proj uses GDAL directly. It
shouldn't rely upon $(PROJLIB) pulling it in.

> and there are quite a few modules that are missing the PROJ lib in  
> linking.
> Something's not working right in the new transformation magic in  
> grass.make.

Right; I committed at the point that everything built okay on my

However, Linux doesn't care about undefined symbols in libraries, so
long as all dependencies are satisfield when the executable is built. 
E.g. if an executable links against the cluster library, the cluster
library's dependencies will be satisfied if the executable is linked
against the raster library.

I'm fairly sure that Windows builds will have the same issue.

I'll use the linkage database generated by tools/sql.sh to accurately
identify the dependencies.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list