Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:899 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28250 invoked by uid 1007); 14 Apr 2003 14:23:44 -0000 Message-ID: <20030414142344.28249.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: jay@php.net Mail-Copies-To: jay@php.net Date: Mon, 14 Apr 2003 10:19:46 -0400 References: <20030412125758.GA5060@mail.host.sk> Lines: 28 User-Agent: KNode/0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Posted-By: 216.94.11.234 Subject: Re: Linking problem with extension written in C++ From: jay@php.net (Jay Smith) There are a few header files that you have to include with extern "C" so their names get mangled properly into C++. Try wrapping php.h, php_ini.h and info.h in extern "C" and see how that goes. I wrote up a little article on this sort of thing, so if you're interested, check out http://www.tutorbuddy.com/software/phpcpp/phpcpp/. J Grzegorz Godlewski wrote: > I have written an extension. Unfortunatelly I had to use some C++. > After building I have some problems with 3 functions: > zval_add_ref, REGISTER_LONG_CONSTANT, php_error_docref. > If I include their body within my extension, it's Ok. > Otherwise I got memory fault under PHP 4.3.0 and > relocation error: /usr/lib/php/xerces.so: undefined symbol: > _Z12zval_add_refPP12_zval_struct under 4.3.1. It has been built by gcc > 3.2.2. Could anyone spend few minutes on it: > http://ggodlewski.host.sk/download/php-xerces/php-xerces-0.1.tar.gz > It requires xerces-c-2.2.0. > Problematic places are marked by MEM_FAULT_HACK macro. > > Thanks, > Grzegorz Godlewski