To learn about Protobuf's protocol generation, you'll need to download its code from the Web and download it from this SVN address:
Http://protobuf.googlecode.com/svn/trunk
After the download is complete, you can go to the Protobuf\vsprojects directory to find the VC2008 project file, and then open the project for conversion, this is no problem. However, there are two problems in the compilation process, the first of which is as follows:
1>------Build Started:Project:gtest_main, Configuration:debug Win32------
1> gtest_main.cc
1>e:\protobuf\gtest\include\gtest\gtest-printers.h (556): Error C2977: ' std::tuple ': too many template
1> C:\Program Files (x86) \microsoft Visual Studio 11.0\vc\include\utility (The): "Declaration of Std::tuple"
1>e:\my\git\protobuf\gtest\include\gtest\gtest-printers.h (564): Error C2977: ' std::tuple ': too many template Arguments
1> C:\Program Files (x86) \microsoft Visual Studio 11.0\vc\include\utility (The): "Declaration of Std::tuple"
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/vc/
Here because of the use of std::tuple, and the number of uses reached 10, so the compilation prompts the error above. Only need to put STD;; The number in the tuple is defined as 10. An easier way to do this is to open Solution Explorer, right-click the project properties, and add the following lines to the--> preprocessor--> preprocessor Definition:
_variadic_max=10
The default definition of _variadic_max in VC2012 is 5, so it does not support more than 5 parameter inputs, resulting in an error. Of course, after this modification, the compilation will occupy a little more memory.
The second question is as follows:
3>------Build Started:project:lite-test, Configuration:debug Win32------
2>test_plugin.obj:warning lnk4075:ignoring '/editandcontinue ' due to '/SAFESEH ' specification
2>gtestd.lib (gtest-all.obj): Error Lnk2038:mismatch detected for ' runtimelibrary ': Value ' mtd_staticdebug ' ' doesn ' t m Atch value ' Mdd_dynamicdebug ' in Test_plugin.obj
3> lite-test.vcxproj-> E:\protobuf\vsprojects\Debug\lite-test.exe
2>msvcprtd.lib (MSVCP110D.dll): Error LNK2005: "Public: __thiscall std::_container_base12::_container_base12 (void )" (?? 0_container_base12@std@ @QAE @xz) already defined in Gtestd.lib (gtest-all.obj)
The reason for this problem is that engineering in the conversion process, there will be some engineering using the MD compilation options, some engineering using MTD compilation options, resulting in static and dynamic connection Msvc Connection library conflict. Default all engineering changes MT or MTD compiles, that can be resolved.