Compile protocol buffers 2.6.1 using VS 2015?

I want to use ProtoBuf 2.6.1 with VS 2015 C ++. However, I cannot link to libprotobuf.lib compiled using VS 2013. I tried to compile libprotobuf.lib again using VS 2015, but I am confusing compilation errors, complaining about <hash_map> and <hash_set> are deprecated.

It looks like the cmake files for ProtoBuf in the GitHub repo are now configured for ProtoBuf 3.0. Is it possible to compile libprotobuf using VS 2015?

+6
source share
3 answers

To run unit tests, you also need to modify a couple of tests that combine the strings with the preprocessor macro in the middle. Just add a space on each side of the macro, and the compiler parser will cope again.

A couple of tests do not work at startup due to directory redirection against the backslash when creating temp files, but that doesn't matter.

Otherwise there are no problems. PS I canโ€™t check, but maybe it was my experience with v3 alpha, not 261, since I am doing this from memory.

Both are building OK on RC, and I think our Jenkins jobs have rebuilt them since moving to 2015. RTM

+3
source

Unfortunately, the cmake build is available starting with protobuf v3.0.0-alpha.

I successfully created protobuf v2.6.1 with MSVC 2015 using the following unofficial cma script. You will need the updated_for_v2.6.1 branch from this repository.

To do this, clone both repositories - protobuf and protobuf-cmake .

Tag checkout v2.6.1 in protobuf clone and origin origin / updated_for_v2.6.1 in protobuf-cmake

cmake <here the path to protobuf-cmake clone> -DPROTOBUF_ROOT = <here the path to protobuf clone> -G "Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX = <here the path to set the target>

Then create it as usual, either from an open source solution or using "cmake -build". Command

NTN.

+3
source

You can reference the build error using Visual Studio 2015 # 314 .

Thanks for the report, but we do not support Visual Studio 2015 right now. Use Visual Studio 2013 until we officially move on to Visual Studio 2015.

Please note that we have a transition plan for Visual Studio 2015, but I would like to focus on other high priority issues at the moment. Sign up for number 315 if you are interested in the progress in supporting Visual Studio 2015 in Mozc for Windows.

However, just fixing build failures is not that difficult. I uploaded the 518f41a conceptual conversion to the support_msvs_2015 branch for your reference only.

+2
source

All Articles