pombreda / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

PHP SWIG kmldom fails because of schema Type() and type() conflict #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. scons RUNSWIG=1

I see:

swig -c++ -Isrc -php5 -c++ -Isrc -o build/php/kmldom_wrap.cc src/swig/kmldom.i
swig: Modules/emit.cxx:340: int emit_action_code(Node*, Wrapper*, String*):
Asse              rtion `DohGetattr(n, "wrap:name")' failed.
scons: *** [build/php/kmldom_wrap.cc] Error -6
scons: building terminated because of errors.

OS: Linux (FC4)
scons 0.97
SWIG 1.3.34 (installed from sources)

Original issue reported on code.google.com by barmi...@gmail.com on 2 Apr 2008 at 8:16

GoogleCodeExporter commented 9 years ago
I saw this when I tried to build on the latest Ubuntu 8.04 beta.

Which version of PHP5 is installed on your machine?

Original comment by kml.mash...@gmail.com on 2 Apr 2008 at 5:08

GoogleCodeExporter commented 9 years ago
PHP 5.2.5 installed. By the way, I removed SWIG 1.3.34 (installed from sources) 
and
i've installed 1.3.31 from rpm-package and at least i've build php and python
bindins.  (I got an 'ruby binding' error only).  I have now some more problems, 
but
it seems to me it's not a libkml bug. I copied kmldom module into php extension 
dir.
The problem is i get 'Fatal error: Cannot redeclare SimpleField::type() in
/usr/local/apache2/htdocs/python/kmldom.php on line 2271' message when i'm 
trying to
run example scripts.

Thanks a lot 

Original comment by barmi...@gmail.com on 3 Apr 2008 at 3:58

GoogleCodeExporter commented 9 years ago
Can you attach a copy of your kmldom.php to a reply?

Original comment by kml.mash...@gmail.com on 3 Apr 2008 at 4:09

GoogleCodeExporter commented 9 years ago
There's my kmldom.php generated by tweak_genereted_kmldom.php script

Original comment by barmi...@gmail.com on 7 Apr 2008 at 3:56

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. Now I see the problem... 

line 32235 of the generated kmldom_wrap.cc for php:
  SWIG_ZEND_NAMED_FE(simplefield_type,_wrap_SimpleField_Type,NULL)
  SWIG_ZEND_NAMED_FE(simplefield_isa,_wrap_SimpleField_IsA,NULL)
  SWIG_ZEND_NAMED_FE(simplefield_type,_wrap_SimpleField_type,NULL)

SWIG's PHP module wants to lower-case all functions, so we have a conflict 
between
the class's Type() function and the getter for the "type" attribute of 
SimpleField.

We'll look into it more.

Original comment by kml.mash...@gmail.com on 7 Apr 2008 at 5:14

GoogleCodeExporter commented 9 years ago
Thank you very much. Is it means you need to fix it and compile a new release ?

Original comment by barmi...@gmail.com on 7 Apr 2008 at 6:49

GoogleCodeExporter commented 9 years ago
I've attached a patch to this reply that should get your tree into a happy 
state.
It's not a real fix -- I've only renamed the type() getter to type_attr().

We'll have to fix this in a more robust way for v0.2.

Original comment by kml.mash...@gmail.com on 7 Apr 2008 at 6:55

Attachments:

GoogleCodeExporter commented 9 years ago
Support for PHP has been deprecated in the latest 0.2.x release. If/when 
support for
PHP and smart pointers is improved in SWIG, we will re-enable PHP bindings to 
libkml.
Not ideal, of course. We'll be keeping our eye on SWIG development.

Original comment by kml.mash...@gmail.com on 6 May 2008 at 6:03