[GRASS-dev] Building a new module for GRASS6.2.3

Glynn Clements glynn at gclements.plus.com
Fri Mar 28 15:56:25 EDT 2008


roberto caselli wrote:

> Thank you very much! How can I edit the raster example to have a c++ source code (.cc extension)?
> I should edit something in the makefile, but I don't how to do. Someone could help me?

Add the following line before including the *.make files (e.g. Module.make):

	MOD_OBJS := $(subst .cc,.o,$(wildcard *.cc))

By default, MOD_OBJS is determined based upon the .c files in the
directory.

Rules.make already includes pattern rules for compiling .cc and .cpp
files.

Note that the GRASS headers don't make allowances for use in C++ code,
so you need to use e.g.:

	extern "C" {
	#include <grass/gis.h>
	}

At some point, we should probably change Rules.make to automatically
deal with C++ files (.cc and .cpp extensions; maybe .cxx as well).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list