Problems linking C++ extension
| From: | Mark Spruiell | Date: | Tue, 17 Feb 2004 19:24:24 +0000 |
| Subject: | Problems linking C++ extension | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7930@lists.php.net to get a copy of this message | ||
Hi,
The header file Zend/zend_interfaces.h contains the following lines:
ZEND_API zend_class_entry *zend_ce_traversable;
ZEND_API zend_class_entry *zend_ce_aggregate;
ZEND_API zend_class_entry *zend_ce_iterator;
ZEND_API zend_class_entry *zend_ce_arrayaccess;
These lines cause "multiple definition" errors when I link my C++
extension with GCC because the declarations lack the "extern" storage
class specifier and therefore cause a new definition in each C++
module that includes this header file.
I assume that it's legal for my extension to include this header file.
Should I submit this as a bug?
I'm using PHP5b4, GCC 3.2.2, RH9.
Thanks,
- Mark