swoole / yasd

Yet Another Swoole Debugger
https://huanghantao.github.io/yasd-wiki/
Apache License 2.0
357 stars 35 forks source link

M2 编译失败(M2 Compilation fails) #176

Closed ctexthuang closed 1 year ago

ctexthuang commented 2 years ago

我本地是安装了boost的 但是依然有问题

I have boost installed locally but still have problems

image

报错信息/Error message

In file included from /usr/local/include/boost/algorithm/string/detail/find_iterator.hpp:18:
In file included from /usr/local/include/boost/function.hpp:30:
In file included from /usr/local/include/boost/function/detail/prologue.hpp:15:
In file included from /usr/local/include/boost/throw_exception.hpp:21:
In file included from /usr/local/include/boost/exception/exception.hpp:9:
/usr/local/include/boost/assert/source_location.hpp:104:13: error: no member named 'ap_php_snprintf' in namespace 'std'; did you mean simply 'ap_php_snprintf'?
            BOOST_ASSERT_SNPRINTF( buffer, ":%lu", co );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/assert/source_location.hpp:81:53: note: expanded from macro 'BOOST_ASSERT_SNPRINTF'
# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::snprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), format, arg)
                                                    ^~~~~
/opt/homebrew/Cellar/php@7.4/7.4.32/include/php/main/snprintf.h:81:12: note: 'ap_php_snprintf' declared here
PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
           ^
2 errors generated.
make: *** [src/remote_debugger.lo] Error 1

系统信息/System message

image
huanghantao commented 1 year ago

可以考虑使用 swoole-src的 xdebug分支,https://github.com/swoole/swoole-src/tree/support-xdebug 可以直接使用xdebug进行调试,前提是PHP版本要大于等于8.1

suktec commented 1 year ago

一样的问题,xdbug分支链接又打不开。好混乱啊

ctexthuang commented 1 year ago

可以考虑使用swoole-src的xdebug支持,https://github.com/swoole/swoole-src/tree/support-xdebug 可以直接使用xdebug进行调试,之前提的是PHP版本要大于等于8.1

可是线上线下大版本差异我感觉不太靠谱

ctexthuang commented 1 year ago

同意,这种四处碰壁。一度想放弃。生态太不完善了

suktec commented 1 year ago

使用boost@1.76编译成功了

huanghantao commented 1 year ago

一样的问题,xdbug分支链接又打不开。好混乱啊

分支已经合并到了master

ctexthuang commented 1 year ago

使用boost@1.76编译成功了

好的会尝试

Songwaitter commented 1 year ago

M1 + Boost 1.80.0 编译成功

删除/usr/local/include/boost/assert/source_location.hpp 104行和97行 BOOST_ASSERT_SNPRINTF即可

如果继续出现ld: library not found for -lboost_filesystem

链接库环境即可 ln -s /opt/homebrew/Cellar/boost/1.80.0/lib/libboost_filesystem.dylib /usr/local/lib/libboost_filesystem.dylib ln -s /opt/homebrew/Cellar/boost/1.80.0/include/boost /usr/local/include/boost

Kevin-Red commented 1 year ago

@Songwaitter 6666666!!