मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग40k · #7470

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/github/awesome-copilot/blob/main/skills/vcpkg/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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 running vcpkg integrate install once.

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:

  1. Create vcpkg.json in your project root:
{
  "name": "my-project",
  "version": "1.0.0",
  "dependencies": ["fmt"]
}
  1. 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)
  1. Configure with vcpkg toolchain:
cmake -B build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake

Adding vcpkg to an Existing Visual Studio Solution

  1. Create vcpkg.json in the solution directory
  2. 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
  3. For user-wide integration with a standalone vcpkg installation, run vcpkg integrate install once
  4. Or for per-project integration, add to .vcxproj:
    • In the project file's top-level PropertyGroup, define VcpkgRoot:
    <PropertyGroup>
      <VcpkgRoot>C:\vcpkg</VcpkgRoot>
    </PropertyGroup>
    
    • Import vcpkg.props near the top of the project file:
    <Import Project="$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg.props" />
    

…

अक्सर पूछे जाने वाले सवाल

'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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस 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 सुनिश्चित करने में उपयोगी है।

AI और एजेंटएजेंट

मिलती-जुलती skills