# Problems linking C++ extension

- Thread: https://externals.io/message/7930
- Original archive: https://news-web.php.net/php.internals/7930
- Started by Mark Spruiell on 2004-02-17T19:24:24+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #7930 — Mark Spruiell — 2004-02-17T19:24:24+00:00

URL: https://externals.io/message/7930#7930

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
