From: carlo dot pastorino at neologica dot it Operating system: Windows 7 PHP version: 5.4.5 Package: Compile Failure Bug Type: Bug Bug description:Extensions out of PHP source tree does not build anymore (link problem)
Description: ------------ I have a PHP extension which adds some "native" functions and zend classes to the PHP framework. This extension is located out of the php source tree and it is built using a Visual Studio 2008 project which should set all the preprocessor definitions and .lib needed. In order to build this extension i'm linking it to the php5ts.lib file included inside the php-devel-pack (which can be downloaded from here http://windows.php.net/downloads/releases/archives/) and, of course, including the *.h files provided with the php-devel-pack. My Visual Studio solution worked fine using php5.2 and php5.3 includes and libs but it fails the compilation using the php5.4 php-devel-pack. In particular I receive a link error: unresolved external symbol "__declspec(dllimport) char const * (__cdecl* zend_new_interned_string)(char const *,int,int,void * * *)" (__imp_?zend_new_interned_string@@3P6APBDPBDHHPAPAPAX@ZA) as if that symbol were not available from the php5ts.lib file. I've generated a simpler Visual Studio solution containing ALL the files needed to build which should present the issue. The solution can be downloaded here: http://www.neologica.it/test_ext_vc9.7z The source code contains a simple php extension and a zend class declaration (Test) having a method: "sayHello". Compiling it using the configuration *_5.3 should produce the dll correctly while using the *_5.4 configuration should trigger the link error. I'm not sure if this is some unfortunate case of undeclared macro in my code / solution, or if there is something that could be done in php source. Test script: --------------- 1 - Extract the archive 2 - Open the solution with Visual Studio (2008 or 2010 is the same) 3 - Select "Release_5.4" or "Debug_5.4" from the build Solution configurations dropdown 4 - Build the extension. Expected result: ---------------- php_test.dll correctly built Actual result: -------------- error LNK2001: unresolved external symbol "__declspec(dllimport) char const * (__cdecl* zend_new_interned_string)(char const *,int,int,void * * *)" (__imp_? zend_new_interned_string@@3P6APBDPBDHHPAPAPAX@ZA) -- Edit bug report at https://bugs.php.net/bug.php?id=62651&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62651&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62651&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62651&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62651&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62651&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62651&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62651&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62651&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62651&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62651&r=support Expected behavior: https://bugs.php.net/fix.php?id=62651&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62651&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62651&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62651&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62651&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62651&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62651&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62651&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62651&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62651&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62651&r=mysqlcfg