下載
protobuf 3.5.1: https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.zip
cmake: https://cmake.org 我用的是 https://cmake.org/files/v3.11/cmake-3.11.0-rc2-win64-x64.msi
編譯
使用 VS2015開發人員命令提示 進入 protobuf 的 cmake 目錄
執行命令:
mkdir release & cd release cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=../../../../install ../.. nmake nmake install ----- mkdir debug & cd debug cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../../../install ../.. nmake nmake install