Not sure if this got posted correctly in the first place but I’ve answered my own question.

 

The problem was that ZEND_DEBUG was not turned off, and ZEND_WIN32 was not set.

 

These pre-processor definitions are all required:

 

ZEND_DEBUG=0   

 

ZEND_WIN32   

 

PHP_WIN32

 

From: Mark Dawson-Butterworth
Sent: 20 December 2013 12:05
To: swig-user@lists.sourceforge.net
Subject: PHP and SWIG with Visual Studio 2010

 

Hi Folks,

 

  I am trying to set up an environment where I can build SWIG wrappers to allow my C code to be called from PHP. It would appear that this is much more straightforward with UNIX/Linux than with Windows! Unfortunately, I have to use Windows.

  As there is no “devel” package, I have built PHP from source in order to create the headers that SWIG uses. So, I can now compile my code using Visual Studio. However, I’ve fallen at the next hurdle.

  I will be most grateful if someone would please advise how I can get/create the library file to link to so that the PHP zend functions don’t all appear as unresolved externals. I thought it would simply be a matter of downloading the Windows PHP binary and using php5.lib from that, but it doesn’t seem to have the right functions in it.

 

All the best,

 

Mark

 


This e-mail and any attachments may contain confidential information. If you believe it has been sent to you in error, please alert the sender immediately by reply e-mail and then delete it, including any attachments. Any disclosure, copying, distribution, or other use of this e-mail, its content or attachments by anyone other than an intended recipient is prohibited. Any views or opinions expressed are the author's and do not necessarily represent those of Zytek Automotive.

Registered Office: Zytek Automotive Limited, Lancaster Road, Fradley Park, LICHFIELD WS13 8RY, UK
Registered in England with the company number 3125253