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?
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
Then build it as usual either from opened solution or using "cmake --build ." command
HTH.
To get the unit tests running you also need to modify a couple of tests that concatenate strings with a preprocessor macro in the middle. Just add a space either side of the macro and the compiler parser can cope again.
A couple of tests fail on running due to directory forward vs back slash when creating temp filenames but those don't matter.
Otherwise no problems. PS I can't actually check but that may have been my experiences with v3 alpha rather than 261 as I'm doing this from memory.
Both build OK on the RC and I think our Jenkins jobs have rebuilt them since moving to 2015 prof RTM
You can refer build error with Visual Studio 2015 #314.