Re: [PHP4BETA] Another prob with PHP4 modules written in C++
| From: | Stanislav Malyshev | Date: | Wed, 22 Mar 2000 15:54:41 +0000 |
| Subject: | Re: [PHP4BETA] Another prob with PHP4 modules written in C++ | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-12495@lists.php.net to get a copy of this message | ||
KR>> DLEXPORT extern "C" void mytest(INTERNAL_FUNCTION_PARAMETERS) {
KR>> pval *arg;
KR>> int arg_count;
KR>>
KR>> arg_count=ARG_COUNT(ht);
KR>> if (arg_count!=1 || getParameters(ht,arg_count,&arg)==FAILURE) {
KR>> WRONG_PARAM_COUNT;
KR>> }
KR>> convert_to_string(arg);
KR>> [ ... ]
KR>> }
KR>>
KR>> If I compile this function (without extern "C") with a C-compiler, the
KR>> resulting library is working. But if I compile this function (with extern "C")
KR>> with a C++-compiler, PHP tells me:
KR>>
KR>> Unable to load dynamic library..... undefined symbol: wrong_param_count__Fv
Seems that your module thinks wrong_param_count is C++ function. How do
you include php.h and other php includes? Did you wrap it with:
extern "C" {
#include all stuff
}
--
Stanislav Malyshev stas@zend.com
+972-3-6139665