problems compiling new PECL module

From: Date: Sat, 08 Jan 2011 22:33:02 +0000
Subject: problems compiling new PECL module
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-7925@lists.php.net to get a copy of this message
Hi, I'm trying to create a PECL module that links libnoise (http://libnoise.sourceforge.net/) to PHP. Libnoise is a collection of C++ classes that can be used for procedural terrain generation, among other things. Altogether, there's about 20 classes that belong to libnoise. I've got two classes connected up and working (noise::module::Const and noise::module::Perlin), but the third one I'm trying to do (noise::module::Abs) has a method (SetSourceModule) that takes a pointer to another noise::module class as one of its parameters. I'm having a hard time understanding how to accept a PHP object as the second parameter. I'm attaching my code so far. The problem occurs in noise_abs.h, which is included in noise.cc (I've been putting each noise module class into a separate file for readability, and then including them in noise.cc). When I run "make", I get: noise_abs.h: In function 'void zim_Noise_Abs_SetSourceModule(int, zval*, zval**, zval*, int)': noise_abs.h:69: error: expected primary-expression before '*' token noise_abs.h:69: error: 'm' was not declared in this scope noise_abs.h:76: error: expected primary-expression before '*' token noise_abs.h:76: error: expected primary-expression before ')' token noise_abs.h:76: error: expected `;' before 'zend_fetch_resource' noise_abs.h: In function 'void zim_Noise_Abs_GetSourceModule(int, zval*, zval**, zval*, int)': noise_abs.h:93: error: expected primary-expression before '*' token noise_abs.h:93: error: 'm' was not declared in this scope noise_abs.h:102: error: invalid conversion from 'zval*' to 'long int' What am I doing wrong here? When all is said and done, using this class will look something like this: <?php $perlin = new Noise_Perlin(); $abs = new Noise_Abs(); $abs->setSourceModule(0, $perlin); echo $abs->getValue(1,2,3); ?> -- Tim Gustafson tjg@tgustafson.com 831-332-1496 http://tgustafson.com/

Attachment: [application/x-gzip] pecl-noise.tgz
« previous php.pecl.dev (#7925) next »