Re: Beginner at writing a PHP Wrapper for C++ libraries
| From: | Johannes Schlüter | Date: | Fri, 12 Jun 2009 21:42:47 +0000 |
| Subject: | Re: Beginner at writing a PHP Wrapper for C++ libraries | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6470@lists.php.net to get a copy of this message | ||
On Fri, 2009-06-12 at 16:41 -0400, "Eric A. Boney" wrote:
> Is it possible to use an object file from the C++ library directly in the
> config.m4 file? I attempted to create a symlink to the cpp file that I needed for
> my extension but I get a ton of errors when I try to make the extension and I
> am guessing it is because this one cpp file that I need requires a ton of other
> header files.
When using cpp, you have to use a C++ compiler, there's a m4 macro
PHP_REQUIRE_CXX, just put that on it's own line and call yur files .cpp
and t should work.
>
> Second question is, I thought I read somewhere that it was possible to create
> a stand alone extension that did not require the end user to install the .so
> file and then modify the php.ini file and restart the apache server. How can I
> do this with my extension and just call/load the .so file in my script(s) that
> need it?
You have two options:
a) either build it shared (using phpize, cofigure, make) and then load
via php.ini or "php -d extionsion=..."
b) build it statically into php by moving it to php-src/ext/$name,
then ./buildconf, ./configure --[enabe|with]-$name.
a) gives you shorter comple/test-cycles, b) can make it simpler for some
debugging stuff (all symbols directly there...)
johannes
> Thanks in advance.
>
> -Eric Bonney
>