Re: C++ in non-threaded PHP

From: Date: Wed, 07 Feb 2007 19:24:58 +0000
Subject: Re: C++ in non-threaded PHP
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-27890@lists.php.net to get a copy of this message
On 02/07/2007 09:53 PM, Caroline Maynard wrote:
Also, how to reproduce it? I compile C++ extensions quite often and do not see any problems.
Well you need to have an extension which references CG() or EG() from C++ and build it with --disable-zts. So, compiling the sdo extension, which refers to, for example, EG(uninitialized_zval_ptr), the link step gives: SDO_DataObject.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct _zend_executor_globals executor_globals" (__imp_?executor_globals@@3U_zend_executor_globals@@A) Debug\php_sdo.dll : fatal error LNK1120: 1 unresolved externals because the references are getting mangled. Putting them inside extern "C" fixes this. (my example was obviously on Windows, but the same should apply on *IX)
Seems to be Windows specific - it works fine with ICC and GCC on Linux. Edin, could you please check this out? -- Wbr, Antony Dovgal

« previous php.internals (#27890) next »