다음 예에서는 C++ 프로그래밍 SDK를 사용하여 자체 프로그램을 빌드하는 방법을 보여줍니다. 이 샘플에서는 Packets 전송 및 수신 예시를 안내하여 이 프로세스를 직접 보여줍니다.
이 안내에서는 두 가지 간단한 프로그램을 빌드하는 방법을 보여줍니다. 첫 번째 프로그램은 일정한 간격으로 메시지를 전송하고 두 번째 프로그램은 첫 번째 프로그램이 전송하는 메시지를 수신합니다. 이러한 프로그램을 시작점으로 사용하여 C++ SDK로 자체 맞춤 애플리케이션을 빌드할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-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)."]]