RE: [PHP] Extensions with C++

From: Date: Sun, 09 Jul 2000 19:01:05 +0000
Subject: RE: [PHP] Extensions with C++
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-5622@lists.php.net to get a copy of this message
not sure, but thise question would seem to fit better on the developer list isntead, probably get a quicker answer there. -----Original Message----- From: John Keiser [mailto:jkeiser@iname.com] Sent: Sunday, July 09, 2000 1:08 AM To: PHP4 Subject: [PHP] Extensions with C++ Hello all, I am trying to make an extension that uses a library written in C++. I have gotten an extension working with C, and I am currently just trying to make the project have two files, a .c and a .C or .cpp file. The .C or .cpp file does not seem to get compiled at all, instead being passed direct on the libtool line. This is what my project looks like (originally generated with ext_skel), with just pertinent info: Makefile.in (only showing the modified line here): ------------------ LTLIBRARY_NAME = libsword.la LTLIBRARY_SOURCES = sword.c sword_int.C LTLIBRARY_SHARED_NAME = sword.la include $(top_srcdir)/build/dynlib.mk ------------------ sword.c: generated by ext_skel, only added #include "sword_inc.h" and have it call browse_inc(). sword_inc.h: ------------------ BEGIN_EXTERN_C() char * browse_int(char * verse); END_EXTERN_C() ------------------ sword_inc.C: ------------------ #include "php.h" #include "sword_int.h" BEGIN_EXTERN_C(); char * browse_int(char * verse) { char * retval = emalloc(strlen(verse) + 9); sprintf(retval, "<B>%s:</B>", verse); return retval; } END_EXTERN_C(); ------------------ I have tried sword_inc.C with and without the EXTERN_C, but since it isn't compiling, I'm guessing the point is moot right now :) It seems like Zend was planning to add C++ support somehow, since the BEGIN_EXTERN_C macro is defined. Any help would be appreciated. --John Keiser -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#5622) next »