Connecting Tech Pros Worldwide Forums | Help | Site Map

Problems with ZEND and DLL and C++

Olaf Schinkel
Guest
 
Posts: n/a
#1: Jul 17 '05
Hello!

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.
This works.
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?

Best
Olaf



Chung Leong
Guest
 
Posts: n/a
#2: Jul 17 '05

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.

Olaf Schinkel
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Problems with ZEND and DLL and C++


Hello!

Yes, thank you.
You know a lot about ZEND.
Is there a documentation available for ZEND?
If yes, where?

Best
Olaf


Chung Leong
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Problems with ZEND and DLL and C++


Comprehensive documentation? Not really. Just some snippets in the PHP
manual. You can learn a lot though just by reading the code. A good
file find utility is very handy for this purpose.

Olaf Schinkel
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Problems with ZEND and DLL and C++


Hello!

Yes, I read some sourcecodes.
My C++ DLL ist running now and works good.

Best
Olaf


Closed Thread