Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

build errors with `_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`

未关闭 适合新手
#80 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, linux
领域
build-system

调研方向

构建输出指出了 src/helpers/buffer.cpp,并显示使用 clang 和 libc++ 编译时,第 87 行和第 137 行缺少 std::string 声明。首先阅读该文件的 include,以及项目针对 _LIBCPP_REMOVE_TRANSITIVE_INCLUDES 选项的构建配置。使用该选项后,报告中的构建成功即表示完成;issue 还建议考虑添加一个 CI job。

由索引模型根据 Issue 内容生成。

描述

FYI, there are some missing includes that are revealed with clang + libc++. It's not too big of a problem, but it might be useful to fix / add ci job.

FAILED: [code=1] src/libpisp.so.1.7.0.p/helpers_buffer.cpp.o 
/usr/bin/ccache clang++ -Isrc/libpisp.so.1.7.0.p -Isrc -I../src -Isrc/libpisp -I../src/libpisp -I/usr/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -D_GLIBCXX_DEBUG=1 -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -std=c++20 -O0 -g -DPISP_LOGGING_ENABLE=1 -DBOOST_BIND_GLOBAL_PLACEHOLDERS -Wno-address-of-packed-member -stdlib=libc++ -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -fPIC -pthread -DBOOST_LOG_DYN_LINK=1 -DBOOST_LOG_SETUP_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_USE_DLL=1 -DBOOST_ALL_NO_LIB -MD -MQ src/libpisp.so.1.7.0.p/helpers_buffer.cpp.o -MF src/libpisp.so.1.7.0.p/helpers_buffer.cpp.o.d -o src/libpisp.so.1.7.0.p/helpers_buffer.cpp.o -c ../src/helpers/buffer.cpp
../src/helpers/buffer.cpp:87:52: error: implicit instantiation of undefined template 'std::basic_string<char>'
   87 |                         throw std::runtime_error("Unable to dup fd: " + std::string(strerror(errno)));
      |                                                                         ^
/usr/bin/../include/c++/v1/__fwd/string.h:43:7: note: template is declared here
   43 | class basic_string;
      |       ^
../src/helpers/buffer.cpp:87:50: error: invalid operands to binary expression ('const char[19]' and 'std::string' (aka 'basic_string<char>'))
   87 |                         throw std::runtime_error("Unable to dup fd: " + std::string(strerror(errno)));
      |                                                  ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../include/c++/v1/__iterator/reverse_iterator.h:293:1: note: candidate template ignored: could not match 'reverse_iterator' against 'basic_string'
  293 | operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) {
      | ^
../src/helpers/buffer.cpp:137:52: error: implicit instantiation of undefined template 'std::basic_string<char>'
  137 |                         throw std::runtime_error("Unable to dup fd: " + std::string(strerror(errno)));
      |                                                                         ^
/usr/bin/../include/c++/v1/__fwd/string.h:43:7: note: template is declared here
   43 | class basic_string;
      |       ^
../src/helpers/buffer.cpp:137:50: error: invalid operands to binary expression ('const char[19]' and 'std::string' (aka 'basic_string<char>'))
  137 |                         throw std::runtime_error("Unable to dup fd: " + std::string(strerror(errno)));
      |                                                  ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../include/c++/v1/__iterator/reverse_iterator.h:293:1: note: candidate template ignored: could not match 'reverse_iterator' against 'basic_string'
  293 | operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) {
      | ^
4 errors generated.
主要语言
C++
星标
14
派生
23
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

raspberrypi/libpisp 的其他 Issue

查看 raspberrypi/libpisp 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。