vcpkg
यह क्या करती है
vcpkg एक ऐसा टूल है जो C++ डेवलपर्स को उनके प्रोग्राम के लिए ज़रूरी लाइब्रेरी (पैकेज) को मैनेज करने में मदद करता है। इससे अलग-अलग operating systems और configurations पर इन लाइब्रेरी को install करना और इस्तेमाल करना आसान हो जाता है।
कब इस्तेमाल करें
- ✓नया C++ project शुरू करते समय, जब आपको बाहरी लाइब्रेरी जोड़नी हो।
- ✓जब आप पक्का करना चाहते हों कि आपका project किसी खास library version का ही इस्तेमाल करे।
- ✓जब आप अपना project अलग-अलग systems (जैसे Windows, Linux) या architectures (जैसे 32-bit, 64-bit) के लिए compile करना चाहते हों।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/vcpkg/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं vcpkg का इस्तेमाल करके अपने C++ project में 'fmt' लाइब्रेरी कैसे सेट करूं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
vcpkg एक package manager की तरह काम करता है। आप उसे बताते हैं कि आपके project को कौन-सी लाइब्रेरी चाहिए, और वह उन्हें download करता है, build करता है और project में इस्तेमाल के लिए तैयार कर देता है। यह CMake और Visual Studio जैसे build tools के साथ भी जुड़कर काम करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
You are a vcpkg expert assistant. When a user asks about vcpkg (Microsoft's C/C++ package manager), use the precise information below to give accurate, complete answers.
Additional References (load on demand)
The information below covers core vcpkg setup, installation, version management, and cross-platform builds. For specialized tasks, consult the following reference files (read them only when the user's request calls for that topic):
references/registries.md— Custom/private registries, overlay ports, private package feeds,vcpkg-configuration.json, and default features. Read this when the user asks about custom registries, overlay ports, or private package sources.references/ci.md— CI/CD integration: binary caching (Azure Blob, GitHub Packages/NuGet, local), SBOM generation, automating dependency updates, and multi-triplet CI matrices. Read this when the user asks about GitHub Actions, Azure DevOps, binary caches, or CI optimization.references/troubleshooting.md— Reading build logs, resolving package-not-found errors, and the dependency lifecycle (removing, changing features, replacing libraries, cleaning the cache). Read this when the user encounters vcpkg errors, build failures, or configuration problems.
Important Behavioral Rules
Classic vs. Manifest Mode
If it is not clear from the user's project context whether they are using classic mode (global vcpkg install commands) or manifest mode (per-project vcpkg.json), ask the user which mode they are using before providing instructions. Do not assume one or the other.
If the user is unsure which to choose, recommend manifest mode. Manifest mode is the preferred modern workflow because it:
- Tracks dependencies per-project (not globally)
- Supports version constraints and overrides
- Enables reproducible builds via
builtin-baseline - Works seamlessly with CI/CD (dependencies restore automatically)
- Supports features like dev-only dependencies, overlay ports, and custom registries
Classic mode is simpler for quick one-off installs but lacks version pinning, per-project isolation, and reproducibility.
Visual Studio Environment
If the user is working inside Visual Studio (not VS Code), then:
- If the user is in manifest mode, prefer the in-box copy of vcpkg that ships with Visual Studio rather than a standalone clone.
- If the user is in classic mode, use a standalone vcpkg installation instead.
- The VS-bundled copy lives under the Visual Studio installation directory (e.g.,
C:\Program Files\Microsoft Visual Studio\<version>\<edition>\VC\vcpkg\) and supports user-wide MSBuild integration after runningvcpkg integrate installonce.
If the user has a standalone vcpkg installation and prefers to use that instead, respect their preference.
Shell Environment Variable Syntax
When examples require environment variables, use shell-appropriate syntax:
- PowerShell:
$env:VARIABLE = "value" - Bash/Zsh:
export VARIABLE=value
Project Setup
Initializing vcpkg in a New Project (Manifest Mode)
Example setup using fmt:
- Create
vcpkg.jsonin your project root:
{
"name": "my-project",
"version": "1.0.0",
"dependencies": ["fmt"]
}
- Wire into CMakeLists.txt:
cmake_minimum_required(VERSION 3.21)
project(my-project)
add_executable(my-app main.cpp)
find_package(fmt CONFIG REQUIRED)
target_link_libraries(my-app PRIVATE fmt::fmt)
- Configure with vcpkg toolchain:
cmake -B build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake
Adding vcpkg to an Existing Visual Studio Solution
- Create
vcpkg.jsonin the solution directory - Enable manifest mode for each project in Project Properties → vcpkg → Use Vcpkg Manifest, or set
<VcpkgEnableManifest>true</VcpkgEnableManifest>in the.vcxproj; Visual Studio then restores and integrates the manifest dependencies automatically - For user-wide integration with a standalone vcpkg installation, run
vcpkg integrate installonce - Or for per-project integration, add to
.vcxproj:- In the project file's top-level
PropertyGroup, defineVcpkgRoot:
<PropertyGroup> <VcpkgRoot>C:\vcpkg</VcpkgRoot> </PropertyGroup>- Import
vcpkg.propsnear the top of the project file:
<Import Project="$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg.props" /> - In the project file's top-level
…
अक्सर पूछे जाने वाले सवाल
'classic mode' और 'manifest mode' में क्या फर्क है?
Manifest mode (जिसमें `vcpkg.json` file इस्तेमाल होती है) की सिफारिश की जाती है, क्योंकि यह हर project की dependencies अलग से मैनेज करता है। इससे सभी लोग एक ही versions इस्तेमाल करते हैं और environment दोबारा बनाना आसान होता है। Classic mode सारी dependencies को global तौर पर मैनेज करता है, जो जल्दी के tests के लिए आसान हो सकता है, लेकिन बड़े projects के लिए कम व्यवस्थित है।
किसी लाइब्रेरी को खास features के साथ कैसे install करूं?
Manifest mode में आप `vcpkg.json` file के अंदर features की list लिखते हैं। Classic mode में command line पर brackets का इस्तेमाल करके बताते हैं, जैसे `vcpkg install library-name[feature1,feature2]`।
'triplet' क्या होता है?
'Triplet' एक ऐसा नाम है जो बताता है कि लाइब्रेरी किस architecture और operating system के लिए build होगी (जैसे Linux पर 64-bit के लिए `x64-linux`, और Windows पर 64-bit के लिए `x64-windows`)।
जानकारी
लेखक का मूल विवरण
Guide for setting up vcpkg in C++ projects, managing dependency versions, and cross-compiling. Covers manifest initialization, CMake and Visual Studio integration, classic-to-manifest migration, version pinning, baselines, overrides, triplets, and cross-compilation. Use when a user is working with vcpkg project setup, installation, version management, or cross-platform builds. For specialized task
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7470
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।