Skip to content

Instantly share code, notes, and snippets.

@SoylentGraham
Last active July 19, 2021 11:33
Show Gist options
  • Save SoylentGraham/c5c06cf4d0a8d2d872a38b94d3a99304 to your computer and use it in GitHub Desktop.
Save SoylentGraham/c5c06cf4d0a8d2d872a38b94d3a99304 to your computer and use it in GitHub Desktop.
How to get a binary of libprotobuf

get vcpkg (c/++ package installer/builder) git clone https://github.com/microsoft/vcpkg

checkout vcpkg commit e6c6d9621 to get protobuf version 3012001 cd ./vcpkg && git checkout e6c6d9621

run this to download/build vcpkg.exe .\vcpkg\bootstrap-vcpkg.bat

install/build protobuf for x64, default is x86(!) .\vcpkg\vcpkg.exe install protobuf:x64-windows

prints out

Stored binary cache: C:\Users\Graham\AppData\Local\vcpkg\archives\f5\f5fb5e0dce210c67f2a8bac4c778e5cc38a05b0e238b7b28f11b4ed56a05a9db.zip

^^^ latest version Version we're using stores output in;

-- Installing: D:/vcpkg/packages/protobuf_x64-windows/tools/protobuf/protoc.exe -- Installing: D:/vcpkg/packages/protobuf_x64-windows/share/protobuf/copyright

open this zipfolder to find includes + lib + dll

If you checkout latest, build, then checkout old version, it won't build. (some protobuf error, cache?) Had to delete & start again.

Error in map_field.inl.h;

error C4800: Implicit conversion from 'google::protobuf::Mapstd::string,cr::proto::models::manifest::ResourcesList::size_type' to bool. Possible information loss

changed to !=0 and it compiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment