Writing PHP4 Extensions in C++
| From: | Klaus Reimer | Date: | Wed, 22 Mar 2000 08:20:01 +0000 |
| Subject: | Writing PHP4 Extensions in C++ | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12479@lists.php.net to get a copy of this message | ||
Hi,
I have written a simple function extension for PHP4 in C and it is working very
good. I can load the library with dl("test.so") and I can call the function
mytest() returning a Test string. But finally I want to write the extension in
C++, so I can use classes and the STL. But when I compile my C-source with the
C++ compiler g++, PHP is refusing to load the library. It tells me, that
test.so is not a PHP library.
I have checked the API header files of PHP4 and there a LOT of compiler
switches concerning C++ in them.
Have I to recompile PHP4 with a C++ compiler to be able to use PHP4 extension
modules written in C++? Is there a configuration switch in the Makefile to
switch to C++? Or is it just impossible to use C++ code for PHP4 extension
libraries?
Bye
K