Gooddbird / tinyrpc

c++ async rpc framework. 14w+qps.
Apache License 2.0
1.26k stars 189 forks source link

C++ 版本问题 #64

Open lx-str opened 1 year ago

lx-str commented 1 year ago

/usr/local/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported." 这个问题是因为什么呢?怎么解决呢?

lx-str commented 1 year ago

安装最新版的protobuf出现这个问题,安装3.19.4版本的protobuf解决了

LextU commented 1 year ago

感谢你的issue和解决方案!3.19.4版本的protobuf可顺利完成编译。

此外,我尝试了在最新版protobuf下将tinyrpc的CMakeList.txt第7行的-std=c++11改为-std=c++17(因为-std=c++14会报关于std的错误),但在cmake过程中报错:

/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
error: ld returned 1 exit status
lx-str commented 1 year ago

感谢你的解答!

对于cmake报错的问题,我在3.21.9版本的protobuf下遇到过。不知你在安装protobuf过程中,protobuf测试是否全部通过?我当时有一个测试不能通过,解决了这个问题后问题得到了解决。(参考https://github.com/protocolbuffers/protobuf/issues/7860 的方法,将内存和CPU数扩大后,测试全部通过。)

可是,出现了新的问题,所调用的函数属于更旧版本的protobuf,因此我最终还是选择了3.19.4版本。