lsl_archived icon indicating copy to clipboard operation
lsl_archived copied to clipboard

wrapping liblsl in php on Windows

Open dmedine opened this issue 9 years ago • 0 comments

Lately I have been working to wrap lsl into a php extension. This has turned out to be rather difficult on windows. First of all, it takes a lot of hacking just to set up a PHP development environment in visual studio, However, I did this and have notes on how to do it if anyone is interested.

Once the extension is built, it doesn't work. There seems to be trouble getting from the php_liblsl.dll to the actual liblsl32.dll. I keep getting the following error from Windows: php_err

Out of curiosity, I removed all the code referring to lsl_create_continuous_resolver_bypred from the swig generated .cpp and .h files that I compiled the php extension with. I got exactly the same error. This is confusing.

I get the sense that PHP is very picky about what extensions it can handle, and that the 'correct' way to do it is to roll them into a fresh build of php.exe -- hopefully preserving all the references correctly. I tried following this tutorial: http://blog.benoitblanchon.fr/build-php-extension-on-windows/ which explains how to use CL tools to build an extension into php on Windows, but couldn't get past the part where after calling buildconf.bat configure --help will reveal the newly included extension flags. they just didn't get created, so I could not go on to the part where you actually build the extension itself.

Next step is to try doing this on Linux (which is clearly how the PHP folks designed the whole thing in the first place) but it would be well to have this working on Windows as well. Anyone know anything about PHP extensions?

dmedine avatar Oct 29 '15 20:10 dmedine