[GRASS-dev] remove raster map in C code

Markus Metz markus.metz.giswork at gmail.com
Fri May 11 07:32:44 PDT 2018


On Fri, May 11, 2018 at 11:54 AM, Luca Delucchi <lucadeluge at gmail.com>
wrote:
>
> On 11 May 2018 at 10:54, Markus Metz <markus.metz.giswork at gmail.com>
wrote:
> > Hi Luca,
> >
>
> Hi Markus,
>
> > On Fri, May 11, 2018 at 10:26 AM, Luca Delucchi <lucadeluge at gmail.com>
> > wrote:
> >>
> >> Hi devs,
> >>
> >> I would like to remove a raster map inside a C module, looking aroung
> >> I found the M_do_remove function used in g.remove and r.reclass. So I
> >> tried to use it but I get error in compilation
> >>
> >> OBJ.x86_64-pc-linux-gnu/main.o: In function `main':
> >> main.c:(.text.startup+0x9eb): undefined reference to `M_get_element'
> >> main.c:(.text.startup+0x9f5): undefined reference to `M_do_remove'
> >> collect2: error: ld returned 1 exit status
> >
> > this is a problem of the linker: you need to link against the manage
lib,
> > see e.g. the Makefile for g.remove. Try
> >
> > LIBES = $(MANAGELIB) $(RASTERLIB) $(GISLIB)
> > DEPENDENCIES = $(MANAGEDEP) $(RASTERDEP) $(GISDEP)
> >
> > in the Makefile of your module.
> >
>
> thanks, now it compile but I get "Segmentation fault", the module is
> r.tile, I attached the diff, could someone have a look to it please?

I think you need to call M_read_list() first, before you loop over the
tiles.

Markus M

>
> > HTH,
> >
> > Markus M
> >
>
>
>
> --
> ciao
> Luca
>
> www.lucadelu.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180511/891744b7/attachment.html>


More information about the grass-dev mailing list