I want to use ProtoBuf 2.6.1 with a VS 2015 C++ application. However, I can't link against libprotobuf.lib compiled using VS 2013. I tried to compile libprotobuf.lib again using VS 2015, but am running into compile errors, complaining about <hash_map>
and <hash_set>
being deprecated.
It looks like the cmake files for ProtoBuf at the GitHub repo are now all set up for ProtoBuf 3.0. Is it still possible to compile libprotobuf using VS 2015?
Protocol buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data in a forward-compatible and backward-compatible way.
To check which version of protobuf is installed, use pip show protobuf or pip3 show protobuf in your Windows CMD, command line, or PowerShell.
In particular, it was designed to be smaller and faster than XML. Protocol Buffers are widely used at Google for storing and interchanging all kinds of structured information. The method serves as a basis for a custom remote procedure call (RPC) system that is used for nearly all inter-machine communication at Google.
Unfortunately, cmake build is available starting from protobuf v3.0.0-alpha.
I've successfully built protobuf v2.6.1 with MSVC 2015 using following unofficial cmake scripts. You need branch updated_for_v2.6.1 from that repository.
For that clone both repositories - protobuf and protobuf-cmake.
Checkout tag v2.6.1 in protobuf clone and branch origin/updated_for_v2.6.1 in protobuf-cmake
cmake < here path to protobuf-cmake clone > -DPROTOBUF_ROOT=< here path to protobuf clone > -G"Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX= < here path for install target >
Then build it as usual either from opened solution or using "cmake --build ." command
HTH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With