<div dir="ltr"><div><div><div>Hi Luca,<br><br>On Fri, May 11, 2018 at 10:26 AM, Luca Delucchi <<a href="mailto:lucadeluge@gmail.com">lucadeluge@gmail.com</a>> 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></div>this is a problem of the linker: you need to link against the manage lib, see e.g. the Makefile for g.remove. Try<br><br>LIBES = $(MANAGELIB) $(RASTERLIB) $(GISLIB)<br>DEPENDENCIES = $(MANAGEDEP) $(RASTERDEP) $(GISDEP)<br><br></div>in the Makefile of your module.<br><br></div><div>HTH,<br><br></div>Markus M<br><div><div><div><br>><br>> In the source code of the module I added #include <grass/manage.h><br>> that it seems the header containing the definition of M_do_remove.<br>><br>> Any idea?<br>><br>> Thanks in advance<br>><br>> --<br>> ciao<br>> Luca<br>><br>> <a href="http://www.lucadelu.org">www.lucadelu.org</a><br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div></div></div></div>