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