Stay organized with collections
Save and categorize content based on your preferences.
The C++ SDK is a tool available as part of the Vertex AI Vision SDK. You can use the
C++ SDK to programmatically manage, control, and perform different forms of
I/O with Vertex AI Vision.
This page describes how to use the C++ SDK to build and test.
The following example shows you how to use the C++ programming SDK to build
your own programs. The sample shows this process directly by walking through
an example for sending and receiving Packets.
These instructions show you how to build two simple programs. The first program
sends messages at regular intervals, while the second program receives the
messages that the first program sends. You can use these programs as a starting
point to build your own custom applications with the C++ SDK.
Go to the root of the source code directory.
The contents of the directory resemble the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Build and test with the C++ SDK\n\nThe C++ SDK is a tool available as part of the Vertex AI Vision SDK. You can use the\nC++ SDK to programmatically manage, control, and perform different forms of\nI/O with Vertex AI Vision.\n\nThis page describes how to use the C++ SDK to build and test.\n\nBefore you begin\n----------------\n\n- Complete the steps to [set up your Google Cloud project](/vision-ai/docs/cloud-environment).\n- Review [system requirements](/vision-ai/docs/cloud-environment#cpp-supported-platforms) before trying to use the C++ SDK.\n- Get the Vertex AI Vision SDK source code from the publicly available\n [GitHub](https://github.com/google/visionai) repository:\n\n git clone https://github.com/google/visionai.git\n\n The C++ public SDK is located in `visionai/public/streams.h`. For reference\n information, see the [reference documentation](/vision-ai/docs/reference/cpp).\n- Install any [system dependencies](/vision-ai/docs/cloud-environment#cpp-system-deps) you might need.\n\n- Use the [create streams and ingest data](/vision-ai/docs/create-manage-streams) topic to\n create stream resources to use in the following code samples.\n\nBuild and test programs\n-----------------------\n\nThe following example shows you how to use the C++ programming SDK to build\nyour own programs. The sample shows this process directly by walking through\nan example for sending and receiving [`Packets`](/vision-ai/docs/reference/cpp/group/packet).\n\nThese instructions show you how to build two simple programs. The first program\nsends messages at regular intervals, while the second program receives the\nmessages that the first program sends. You can use these programs as a starting\npoint to build your own custom applications with the C++ SDK.\n\n1. Go to the root of the source code directory.\n\n The contents of the directory resemble the following: \n\n bazel BUILD CONTRIBUTING.md debian deps.bzl LICENSE README.md third_party visionai [...]\n\n2. Optional: Read the tutorial source code instructions.\n\n **Sender app:** \n\n cat visionai/public/tutorial/sender_app.cc\n\n **Receiver app:** \n\n cat visionai/public/tutorial/receiver_app.cc\n\n3. Build the sender and receiver apps.\n\n bazel build //visionai/public/tutorial/...\n\n4. Verify the build worked. In one terminal, run the following command for the\n sender app. Replace the following:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your location ID. For example, `us-central1`. [Supported regions](/vision-ai/docs/warehouse-supported-regions). [More information](/about/locations).\n - \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e: The stream ID that you created in the cluster. For example, `input-1`.\n\n ```\n ./bazel-bin/visionai/public/tutorial/sender_app \\\n --service_endpoint visionai.googleapis.com \\\n --project_id PROJECT_ID \\\n --location_id LOCATION_ID \\\n --cluster_id application-cluster-0 \\\n --stream_id STREAM_ID\n ```\n5. In a different terminal, run the following command for the\n receiver app. Replace the following:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your location ID. For example, `us-central1`. [Supported regions](/vision-ai/docs/warehouse-supported-regions). [More information](/about/locations).\n - \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e: The stream ID that you created in the cluster. For example, `input-1`.\n\n ```\n ./bazel-bin/visionai/public/tutorial/receiver_app \\\n --service_endpoint visionai.googleapis.com \\\n --project_id PROJECT_ID \\\n --location_id LOCATION_ID \\\n --cluster_id application-cluster-0 \\\n --stream_id STREAM_ID\n ```\n\nWhat's next\n-----------\n\n- Read about processing components you can add to an app in [Build an app](/vision-ai/docs/build-app).\n- Learn about output storage and processing options in [Connect app output to a data destination](/vision-ai/docs/connect-data-destination).\n- Read about how to [Search Warehouse data in the console](/vision-ai/docs/search-streaming-warehouse)."]]