Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
C++ SDK adalah alat yang tersedia sebagai bagian dari Vertex AI Vision SDK. Anda dapat menggunakan
C++ SDK untuk mengelola, mengontrol, dan menjalankan berbagai bentuk
I/O secara terprogram dengan Vertex AI Vision.
Halaman ini menjelaskan cara menggunakan C++ SDK untuk mem-build dan menguji.
Contoh berikut menunjukkan cara menggunakan SDK pemrograman C++ untuk mem-build
program Anda sendiri. Contoh ini menunjukkan proses ini secara langsung dengan membahas
contoh untuk mengirim dan menerima Packets.
Petunjuk ini menunjukkan cara mem-build dua program sederhana. Program pertama
mengirim pesan secara berkala, sedangkan program kedua menerima
pesan yang dikirim program pertama. Anda dapat menggunakan program ini sebagai titik awal untuk mem-build aplikasi kustom Anda sendiri dengan C++ SDK.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 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)."]]