You should now have cardboard_device.pb.cc and cardboard_device.pb.h.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThis guide provides step-by-step instructions for generating Protocol Buffers source files for iOS, starting with C++ file generation from a proto file.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves downloading and utilizing the Protocol Buffers Compiler, locating the 'proto' folder within the Cardboard repository, and executing specific commands to produce the necessary C++ source files (cardboard_device.pb.cc and cardboard_device.pb.h).\u003c/p\u003e\n"],["\u003cp\u003eThese steps were tested on a Mac running macOS Big Sur v11.6 and require Protocol Buffers Compiler v3.18.0.\u003c/p\u003e\n"]]],[],null,["# Generate Protocol Buffers files for iOS\n\n| **Note:** These steps were tested using a Mac machine running macOS Big Sur v11.6.\n\nThis guide shows you how to generate the [Protocol Buffers](https://developers.google.com/protocol-buffers) source files for iOS from scratch.\n\n### Generate C++ source files from the proto file\n\n1. [Download the Protocol Buffers Compiler v3.18.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.18.0) on your local machine.\n\n2. Unzip it.\n\n3. Check its version:\n\n ```\n ./bin/protoc --version\n ```\n\n You should have `libprotoc 3.18.0`.\n4. In the Cardboard repository, locate the `proto` folder and save its path.\n\n5. Generate the Protocol Buffers source files in C++:\n\n ```\n ./bin/protoc --proto_path=$PROTO_FOLDER_PATH --cpp_out=$PROTO_FOLDER_PATH cardboard_device.proto\n ```\n\n You should now have **cardboard_device.pb.cc** and **cardboard_device.pb.h**."]]