Connecting Tech Pros Worldwide Help | Site Map

Problems with ZEND and DLL and C++

  #1  
Old July 17th, 2005, 02:30 PM
Olaf Schinkel
Guest
 
Posts: n/a
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


  #2  
Old July 17th, 2005, 02:30 PM
Chung Leong
Guest
 
Posts: n/a

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.

  #3  
Old July 17th, 2005, 02:30 PM
Olaf Schinkel
Guest
 
Posts: n/a

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


  #4  
Old July 17th, 2005, 02:30 PM
Chung Leong
Guest
 
Posts: n/a

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.

  #5  
Old July 17th, 2005, 02:30 PM
Olaf Schinkel
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opinions on Zend Core for Oracle over PHP 5.1.4?! James answers 1 September 24th, 2006 03:45 AM
php_sqlite.dll recall? topmind answers 4 July 17th, 2006 05:45 AM
Cannot use mail() in IE, only works in a debugger--help baustin75@gmail.com answers 8 October 5th, 2005 06:15 PM
Trouble with system() function Penn Markham answers 9 July 17th, 2005 05:43 AM