I have tried a hundred things and I can not get my .so file to interface with php using swig. I can generate the files, then I had to compile Zend and link with that to make the .so but it keeps seg faulting on load now.
Can some one please walk me though how to use swig to generate a PHP interface for a C++ library? The documentation on the swig web site is not helpful.
This example seems informative. Have you tried it?
I was stuck in the same situation but then the answer by Gaius clarified that the example.i file must be created first, it is not just a fancy parameter to tell swig the name of your project. Paragraph 2.3.1 of that guide! tells what this example.i file is about.
/* File : example.i */
%module example
%{
/* Put headers and other declarations here */
extern double My_variable;
extern int fact(int);
extern int my_mod(int n, int m);
%}
extern double My_variable;
extern int fact(int);
extern int my_mod(int n, int m);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With