Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Problems with ZEND and DLL and C++
- Olaf Schinkel
June 7, 2005, 10:34 pm
rate this thread
I´m not sure if this is the right group...
.... if not, please tell me the right one.
Ich compile a DLL with VC6 with the switch /Tc.
So the DLL compiles as a C DLL.
But I need a class in my DLL.
When I compile without the switch, it compiles, but PHP says me, that that
is not a valid PHP DLL.
Is there an example how to compile a PHP C++ DLL?
Or can anybody give me a hint?
Re: Problems with ZEND and DLL and C++
You're developing for PHP4, I bet. The old v4 ZEND_GET_MODULE() macro
doesn't sandwish its definition in a BEGIN_EXTERN_C()/END_EXTERN_C()
pair, so the function it defines is exported with a C++ mangled name.
Putting a BEGIN_EXTERN_C() before ZEND_GET_MODULE() and a
END_EXTERN_C() after should fix the problem.
This problem is fixed in the v5 source.