Connecting Tech Pros Worldwide Help | Site Map

Problems with ZEND and DLL and C++

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:30 PM
Olaf Schinkel
Guest
 
Posts: n/a
Default Problems with ZEND and DLL and C++

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, 01:30 PM
Chung Leong
Guest
 
Posts: n/a
Default 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, 01:30 PM
Olaf Schinkel
Guest
 
Posts: n/a
Default 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, 01:30 PM
Chung Leong
Guest
 
Posts: n/a
Default 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, 01:30 PM
Olaf Schinkel
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.