These are the first lines of r.example main.c (that I renamed in main.cc)<br><br>#include &lt;stdio.h&gt;&nbsp;&nbsp;&nbsp; <br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br><br>extern "C"<br>{<br>&nbsp;#include &lt;grass/gis.h&gt;<br>&nbsp;#include &lt;grass/glocale.h&gt;<br>}&nbsp;&nbsp;&nbsp; <br><br>extern CELL f_c(CELL);<br>extern FCELL f_f(FCELL);<br>extern DCELL f_d(DCELL);<br>&nbsp; ....<br><br>And this is its makefile I edit as you told me to do:<br><br>MODULE_TOPDIR = ../..<br>PGM = r.example<br><br>LIBES = $(GISLIB)<br>DEPENDENCIES = $(GISDEP)<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  <br>MOD_OBJS := $(subst .cc,.o,$(wildcard *.cc)) &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; <br>include $(MODULE_TOPDIR)/include/Make/Module.make<br>&nbsp;<br>default: cmd<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>Then I typed make and here the message:<br><br>make: *** No rule to make target `OBJ.i686-pc-linux-gnu/main.o', needed by
 `/home/roberto/grass/grass-6.2.3/dist.i686-pc-linux-gnu/bin/r.example'.&nbsp; Stop.<br>roberto@roberto-laptop:~/grass/grass-6.2.3/raster/r.example$ <br><br><br><b><i>Glynn Clements &lt;glynn@gclements.plus.com&gt;</i></b> ha scritto:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <br>roberto caselli wrote:<br><br>&gt; Thank you very much! How can I edit the raster example to have a c++ source code (.cc extension)?<br>&gt; I should edit something in the makefile, but I don't how to do. Someone could help me?<br><br>Add the following line before including the *.make files (e.g. Module.make):<br><br> MOD_OBJS := $(subst .cc,.o,$(wildcard *.cc))<br><br>By default, MOD_OBJS is determined based upon the .c files in the<br>directory.<br><br>Rules.make already includes pattern rules for compiling .cc and .cpp<br>files.<br><br>Note that the GRASS headers don't make allowances for use in C++ code,<br>so you need to
 use e.g.:<br><br> extern "C" {<br> #include <grass gis.h=""><br> }<br><br>At some point, we should probably change Rules.make to automatically<br>deal with C++ files (.cc and .cpp extensions; maybe .cxx as well).<br><br>-- <br>Glynn Clements <glynn@gclements.plus.com><br></glynn@gclements.plus.com></grass></blockquote><br><p>&#32;







      <hr size=1><font face="Arial" size="2">Scopri il <a href="http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F"> Blog di Yahoo! Mail</a>: trucchi, novità, consigli... e la tua opinione!</font>