php-tdengine icon indicating copy to clipboard operation
php-tdengine copied to clipboard

编译报错

Open ashuwp opened this issue 3 years ago • 1 comments

大佬,编译到最后make就报错了。 大概如下: In file included from /usr/local/php/include/php/main/php.h:441, from /root/php-tdengine/include/ext_tdengine.h:16, from /root/php-tdengine/src/ext_taos.cc:1: /root/php-tdengine/include/ext_taos.h: In function ‘void register_constants(int)’: ./php_tdengine.h:9:31: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 9 | # define PHP_TDENGINE_VERSION "1.0.5" /usr/local/php/include/php/Zend/zend_constants.h:62:149: note: in definition of macro ‘REGISTER_NS_STRING_CONSTANT’ 62 | #define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number) | ^~~ /root/php-tdengine/include/ext_taos.h:19:66: note: in expansion of macro ‘PHP_TDENGINE_VERSION’ 19 | REGISTER_NS_STRING_CONSTANT("TDengine", "EXTENSION_VERSION", PHP_TDENGINE_VERSION, CONST_CS | CONST_PERSISTENT); | ^~~~~~~~~~~~~~~~~~~~ /root/php-tdengine/include/ext_taos.h:20:83: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] 20 | REGISTER_NS_STRING_CONSTANT("TDengine", "CLIENT_VERSION", taos_get_client_info(), CONST_CS | CONST_PERSISTENT); /usr/local/php/include/php/Zend/zend_constants.h:62:149: note: in definition of macro ‘REGISTER_NS_STRING_CONSTANT’ 62 | #define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number) | ^~~ /usr/local/php/include/php/Zend/zend_constants.h:86:86: note: initializing argument 3 of ‘void zend_register_string_constant(const char*, size_t, char*, int, int’ 86 | ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char strval, int flags, int module_number); | ~~~~~~^~~~~~ In file included from /usr/local/php/include/php/main/php.h:441, from /root/php-tdengine/tdengine.cc:7: /root/php-tdengine/include/ext_taos.h: In function ‘void register_constants(int)’: /root/php-tdengine/php_tdengine.h:9:31: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 9 | # define PHP_TDENGINE_VERSION "1.0.5" /usr/local/php/include/php/Zend/zend_constants.h:62:149: note: in definition of macro ‘REGISTER_NS_STRING_CONSTANT’ 62 | ine REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number) | ^~~

/root/php-tdengine/include/ext_taos.h:19:66: note: in expansion of macro ‘PHP_TDENGINE_VERSION’ 19 | REGISTER_NS_STRING_CONSTANT("TDengine", "EXTENSION_VERSION", PHP_TDENGINE_VERSION, CONST_CS | CONST_PERSISTENT); | ^~~~~~~~~~~~~~~~~~~~ /root/php-tdengine/include/ext_taos.h:20:83: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] 20 | REGISTER_NS_STRING_CONSTANT("TDengine", "CLIENT_VERSION", taos_get_client_info(), CONST_CS | CONST_PERSISTENT); /usr/local/php/include/php/Zend/zend_constants.h:62:149: note: in definition of macro ‘REGISTER_NS_STRING_CONSTANT’ 62 | ine REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number) | ^~~

/usr/local/php/include/php/Zend/zend_constants.h:86:86: note: initializing argument 3 of ‘void zend_register_string_constant(const char*, size_t, char*, int, int’ 86 | ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int flags, int module_number); | ~~~~~~^~~~~~ make: *** [Makefile:194: src/ext_taos.lo] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Makefile:192: tdengine.lo] Error 1

ashuwp avatar Sep 03 '22 13:09 ashuwp

https://github.com/Yurunsoft/php-tdengine/commit/60cb99f1d0c0c935c99b741d3219f2fe45acd021 已修复,尝试重新编译一下master 分支的代码

Yurunsoft avatar Sep 05 '22 01:09 Yurunsoft