Baidu for a long time, the method introduced many are not applicable, the search out of the article is to find the project file vs Balabala ..., But because the latest version of Gihub on the protobuf3.3.0, is not with the project file with VS, the official Readme feel a bit biased Linux platform, I stuck for a long time.
Then a thought, let the search engine results only show nearly 1 years of results, directly there. It is not difficult to create vs. project files yourself with the CMake tool.
The following is the original text:
First, download protobuf
: https://github.com/google/protobuf/releases
Second, download CMake
: https://cmake.org/download/
My system is 64-bit, so the download is a 64-bit installation package, you can view their own situation to download the appropriate installation package
Iii. generation of PROTOBUF vs Engineering
Open CMake (Cmake-gui), select the CMake directory under the Protobuf directory respectively, and the directory where you want vs project files;
Iv. Generating PROTOBUF Libraries
Find the generated vs project open, there are a lot of projects, we only care about two projects in the Red box, set x64, MTD compile,
Libprotobuf.lib, Libprotoc.lib, Protoc.exeare generated under the Debug and release directories in the project catalog.
Plus the Src\google directory header file, you can use
V. Use of PROTOBUF
5.1 Put Protoc.exe into a directory, create a new BUILD.bat file, write the content Protoc--cpp_out=./*.proto
5.2 Place the existing. proto file in this directory, execute BUILD.bat, and automatically generate the corresponding H and CC files
5.3 In Application engineering, add protobuf Src\google directory header files and libprotobuf.lib, Libprotoc.lib Library dependencies, plus the generated PB protocol H and CC files can parse the PB format protocol
(Original address: http://blog.sina.com.cn/s/blog_62949ff40102x2wo.html)
------------------------------------------------
>> My supplement:
------------------------------------------------
1, after the completion of the compilation, you can find 3 lib and an EXE file under Vsprojects\release, They are libprotobuf.lib,libprotobuf-lite.lib,libprotoc.lib and Protoc.exe respectively. (the compilation mode is release mode), you can copy the Lib file to a Lib directory;
2. Copy the Google folder under the SRC directory under the downloaded PROTOBUF source directory to an include directory;
3, the directory structure is as follows
... \installed third party\pb\compile\include\ ....
... \installed third party\pb\compile\lib\ ....
... \installed third Party\pb\compile\protoc.exe
4, packaged, share the following links:
Link: http://pan.baidu.com/s/1c1JZjmo Password: F4QR
------------------
QT references and later to add ...
Install protobuffer3.x (with compiled resources) on "Protobuffer" windows