700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > fatal error: google/protobuf/stubs/stringprintf.h: No such file or directory

fatal error: google/protobuf/stubs/stringprintf.h: No such file or directory

时间:2018-09-28 18:38:51

相关推荐

fatal error: google/protobuf/stubs/stringprintf.h: No such file or directory

解决make时出现的google的fatal error: google/protobuf/stubs/stringprintf.h:

主要原因是在include文件夹中找不到相应的文件,解决办法:

1、使用命令protoc --version,查看目前安装的proto的版本,确定在3.0以上,如果不是,请更新:

sudo apt-get install libprotobuf-dev protobuf-compiler

2、更新完之后还是没有解决:在电脑中查找stringprintf.h文件,这里使用find -name stringprintf.h查找,我这里查找到的路径是:

1、./.local/share/Trash/files/protobuf-all-3.17.3/protobuf-3.17.3/src/google/protobuf/stubs/stringprintf.h2、./install/protobuf-all-3.17.3/protobuf-3.17.3/src/google/protobuf/stubs/stringprintf.h

3、确定cmake中的include_directories(${PROTOBUF_INCLUDE_DIRS})是什么路径,我在这里的路径是:/usr/local/include

这里cd到/google/protobuf/stubs下。ls查看是否缺失文件,(缺失)

使用 sudo cp stringprintf.* /usr/local/include/google/protobuf/stubs,将所有文件拷贝过来。

4、在/usr/local/include/google/protobuf/stubs下查看是否拷贝成功

ls

5、make
6、done。
7、另,有人说可以在cmakelists中添加include_directories(${PROTOBUF_PATH) /src}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。