swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

swoole 5.1.2编译安装提示error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’

Open hanwei88 opened this issue 10 months ago • 7 comments

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

thirdparty/php83/Zend/zend_call_stack.cc:106:28: error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’? 106 | return getpid() == gettid(); | ^~~~~~ | getuid make: *** [Makefile:573:thirdparty/php83/Zend/zend_call_stack.lo] 错误 1

hanwei88 avatar Apr 22 '24 00:04 hanwei88

麻烦提供一下编译的环境参数

NathanFreeman avatar Apr 22 '24 02:04 NathanFreeman

麻烦提供一些编译的环境参数

./configure --with-php-config=/media/hanwei/68477DFF36C47279/php/83/bin/php-config --enable-openssl --enable-swoole-curl --enable-cares --enable-brotli --enable-swoole-pgsql --enable-swoole-sqlite --enable-mysqlnd --enable-sockets && make -j8 && make -j8 install

hanwei88 avatar Apr 22 '24 14:04 hanwei88

服务器是什么类型的服务器,php的版本是多少

NathanFreeman avatar Apr 22 '24 14:04 NathanFreeman

deepin 23 beta3 ,php版本是 php-8.3

deepin 23 beta3 ,php版本是 php-8.3

hanwei88 avatar Apr 22 '24 16:04 hanwei88

服务器是什么类型的服务器,php的版本是多少 这与系统没啥关系吧,swoole 5.1.1版本可以编译的

hanwei88 avatar Apr 22 '24 16:04 hanwei88

deepin的系统我得下载一个看看,可能真的没gettid这个函数

NathanFreeman avatar Apr 25 '24 10:04 NathanFreeman

deepin我得下载一个看看,可能真的没有gettid这个函数

我在/media/hanwei/68477DFF36C47279/软件包/编程/php/swoole-src-5.1.2/thirdparty/php83/Zend/zend_call_stack.cc头部加上这个就可以编译通过了: image image

#include <sys/syscall.h> #define gettid() syscall(__NR_gettid)

hanwei88 avatar Apr 26 '24 01:04 hanwei88

已移除 gettid 相关代码

matyhtf avatar Sep 04 '24 10:09 matyhtf