Protobuf有很多版本了,现在项目组使用的Visual Studio还是2005,所以不支持C++11,在引入Protobuf时既想找到一个proto3的可用的最新版本,又要不使用C++11,在连续下载和尝试,和阅读Protobuf的每个版本的发行日志时,发现了这样一段话
- Starting from this release, we now require C++11. For those we cannot yet upgrade to C++11, we will try to keep the 3.5.x branch updated with critical bug fixes only. If you have any concerns about this, please comment on issue #2780.
- Moved to C++11 types like std::atomic and std::unique_ptr and away from our old custom-built equivalents.
有需要关注的关键字we noew require C++ 11。是哪个版本呢?
也即大家在项目中不支持C++11的,用v.3.6.0之前的protobuf就好。不会编译不过。
PS:亲自尝试了下,3.5.0和3.4.0在VS2005下还是会有报错,直到3.30才编译通过。