# Missing symbol upon loading module

- Thread: https://externals.io/message/19107
- Original archive: https://news-web.php.net/php.internals/19107
- Started by David Olsson on 2005-09-21T10:20:52+00:00
- Messages: 2
- 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

---

## #19107 — David Olsson — 2005-09-21T10:20:52+00:00

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

I have a PHP extension written in C++ which I use for parsing and 
building WbXml documents. I have tested building and using it on a 32 
bit x86 system running the following:

PHP 4.3.10
GCC 3.3.5
Gentoo Linux 2.6.10-r4

Everything works fine on this configuration. I do however need the 
extension to run on a x86 64 bits machine using the following configuration:

PHP 4.4.0
GCC 3.2.3
RedHat Enterprise Linux 3 2.4.21-15

Everything compiles fine, no errors. When PHP tries to load the module 
however, I get the following error:

PHP Warning:  Unknown(): Unable to load dynamic library 
'/usr/local/php4/extensions/php_wbxml.so' - 
/usr/local/php4/extensions/php_wbxml.so: undefined symbol: 
__gxx_personality_v0 in Unknown on line 0

The name of the module is, obviously, php_wbxml.so. What does this error 
mean? I have tried to explicitly link against libsupc++ (which, from 
what I can gather, should include the __gxx_personality_v0 symbol) but 
the same error remains.

I have moved other modules without problems between the two systems but 
this one doesn't seem to work.

Here's the config.m4 I am using:

PHP_ARG_ENABLE(php_wbxml, whether to enable WbXml support,
[--enable-php_wbxml  Enable WbXml support])

if test "$PHP_PHP_WBXML" = "yes"; then
	PHP_REQUIRE_CXX()
	PHP_ADD_LIBRARY(stdc++, 1, PHP_WBXML_SHARED_LIBADD)
	AC_DEFINE(HAVE_PHP_WBXML, 1, [whether you have WbXml])
	PHP_NEW_EXTENSION(php_wbxml, php_wbxml.cpp TextXmlDocument.cpp 
tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp 
WbXmlDocument.cpp XmlAttribute.cpp XmlDocument.cpp XmlElement.cpp 
XmlHandle.cpp XmlNode.cpp XmlText.cpp, $ext_shared)
fi

VERY grateful for any tips on how to proceed.

Best regards
David Olsson

---

## #19108 — David Olsson — 2005-09-21T12:22:45+00:00

URL: https://externals.io/message/19107#19108 · In reply to: #19107

Nevermind. The config.m4 was messed up so that the module never linked 
against libstd++ which, of course, caused som missing symbols.

Best regards
David Olsson


David Olsson wrote:
> I have a PHP extension written in C++ which I use for parsing and 
> building WbXml documents. I have tested building and using it on a 32 
> bit x86 system running the following:
> 
> PHP 4.3.10
> GCC 3.3.5
> Gentoo Linux 2.6.10-r4
> 
> Everything works fine on this configuration. I do however need the 
> extension to run on a x86 64 bits machine using the following 
> configuration:
> 
> PHP 4.4.0
> GCC 3.2.3
> RedHat Enterprise Linux 3 2.4.21-15
> 
> Everything compiles fine, no errors. When PHP tries to load the module 
> however, I get the following error:
> 
> PHP Warning:  Unknown(): Unable to load dynamic library 
> '/usr/local/php4/extensions/php_wbxml.so' - 
> /usr/local/php4/extensions/php_wbxml.so: undefined symbol: 
> __gxx_personality_v0 in Unknown on line 0
> 
> The name of the module is, obviously, php_wbxml.so. What does this error 
> mean? I have tried to explicitly link against libsupc++ (which, from 
> what I can gather, should include the __gxx_personality_v0 symbol) but 
> the same error remains.
> 
> I have moved other modules without problems between the two systems but 
> this one doesn't seem to work.
> 
> Here's the config.m4 I am using:
> 
> PHP_ARG_ENABLE(php_wbxml, whether to enable WbXml support,
> [--enable-php_wbxml  Enable WbXml support])
> 
> if test "$PHP_PHP_WBXML" = "yes"; then
>     PHP_REQUIRE_CXX()
>     PHP_ADD_LIBRARY(stdc++, 1, PHP_WBXML_SHARED_LIBADD)
>     AC_DEFINE(HAVE_PHP_WBXML, 1, [whether you have WbXml])
>     PHP_NEW_EXTENSION(php_wbxml, php_wbxml.cpp TextXmlDocument.cpp 
> tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp 
> WbXmlDocument.cpp XmlAttribute.cpp XmlDocument.cpp XmlElement.cpp 
> XmlHandle.cpp XmlNode.cpp XmlText.cpp, $ext_shared)
> fi
> 
> VERY grateful for any tips on how to proceed.
> 
> Best regards
> David Olsson
