欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 明星 > 使用protobuf编译提示无法打开包括文件: ‘absl/log/absl_log.h’: No such file or directory

使用protobuf编译提示无法打开包括文件: ‘absl/log/absl_log.h’: No such file or directory

2025/4/17 13:13:31 来源:https://blog.csdn.net/qq_43361844/article/details/147044349  浏览:    关键词:使用protobuf编译提示无法打开包括文件: ‘absl/log/absl_log.h’: No such file or directory

问题原因

  1. Protobuf 依赖 Abseil

    • Protobuf 3.20+ 版本开始依赖 Abseil,但你的系统未正确安装或配置 Abseil。

  2. 头文件路径未包含

    • 编译器找不到 absl/log/absl_log.h,可能是因为 Abseil 未正确安装或未在项目中设置包含路径。 

 安装Abseil 库

使用手动编译Abseil源码的方式

1、下载源码

git clone https://github.com/abseil/abseil-cpp.git

2、使用CMake生成Visual Studio 项目

cd abseil-cpp

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX="C:\abseil" -G "Visual Studio 16 2019" -A x64

3、找到生成的visual studio 的sln 后缀文件使用visual studio 2019 打开编译 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词