Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Das C++ SDK ist ein Tool, das im Rahmen des Vertex AI Vision SDK verfügbar ist. Mit dem C++ SDK können Sie verschiedene Formen der E/A mit Vertex AI Vision programmatisch verwalten, steuern und ausführen.
Auf dieser Seite wird beschrieben, wie Sie das C++ SDK zum Erstellen und Testen verwenden.
Im folgenden Beispiel wird gezeigt, wie Sie mit dem C++-Programmier-SDK eigene Programme erstellen. Im Beispiel wird dieser Vorgang direkt veranschaulicht, indem ein Beispiel für das Senden und Empfangen von Packets durchgegangen wird.
In dieser Anleitung erfahren Sie, wie Sie zwei einfache Programme erstellen. Das erste Programm sendet Nachrichten in regelmäßigen Abständen, während das zweite Programm die vom ersten Programm gesendeten Nachrichten empfängt. Sie können diese Programme als Ausgangspunkt verwenden, um mit dem C++ SDK eigene benutzerdefinierte Anwendungen zu erstellen.
Rufen Sie das Stammverzeichnis des Quellcodeverzeichnisses auf.
Der Inhalt des Verzeichnisses sieht in etwa so aus:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (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)."]]