Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

msvc-clmsvc CL 搜索

Agent Skill

msvc-cl 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,763

周安装

114

GitHub Stars

80

下载量

903
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:msvc-cl(msvc CL 搜索)
来源仓库:https://github.com/mohitmishra786/low-level-dev-skills
仓库路径:skills/msvc-cl
安装命令:
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill msvc-cl
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill msvc-cl

简介

msvc-cl 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中获取信息的场景。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写操作。
  • msvc-cl 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

MSVC cl.exe and clang-cl

Purpose

Guide agents through Windows C/C++ compilation: MSVC cl.exe, clang-cl as MSVC-compatible driver, MSBuild project settings, and runtime library choices.

Triggers

  • "How do I compile with MSVC from the command line?"
  • "What is the MSVC equivalent of -O2?"
  • "/MT vs /MD — which do I use?"
  • "How do I use clang-cl instead of cl.exe?"
  • "I'm getting LNK errors on Windows"
  • "How do I generate PDB files?"

Workflow

1. Set up the environment

MSVC requires the Visual Studio environment variables. Use the Developer Command Prompt or set up manually:

REM x64 native
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

REM x86 cross (host x64, target x86)
"...\vcvarsamd64_x86.bat"

REM Check compiler version
cl /?

In CMake, use the "Visual Studio 17 2022" generator or pass -DCMAKE_GENERATOR="Visual Studio 17 2022".

2. Flag translation: GCC → MSVC

GCC/ClangMSVC cl.exeNotes
-O0/OdDebug, no optimisation
-O1/O1Minimise size
-O2/O2Maximise speed
-O3/OxFull optimisation
-Os/OsFavour size
-g/ZiPDB debug info
-g (embedded)/Z7Debug info in object file
-Wall/W3 or /W4Warning level
-Werror/WXWarnings as errors
-std=c++17/std:c++17Standard selection
-DFOO=1/DFOO=1Preprocessor define
-I path/I pathInclude path
-c/cCompile only (no link)
-o out/Fe:out.exe or /Fo:out.objOutput file
-shared/LDBuild DLL
-fPIC(implicit on Windows)Not needed on Windows
-flto/GL (compile) + /LTCG (link)Whole program optimisation

3. Runtime library selection

This is the most common source of LNK errors on Windows.

FlagRuntimeUse case
/MDMSVCRT.dll (dynamic)Release, DLL linkage (recommended default)
/MDdMSVCRTd.dll (debug dynamic)Debug builds
/MTStatic CRTStandalone exe; avoid mixing with DLLs
/MTdStatic CRT debugDebug + static

Rule: All objects and libraries in a link must use the same runtime. Mixing /MT and /MD causes LNK2038: mismatch detected.

4. clang-cl

clang-cl is Clang's MSVC-compatible driver. It accepts cl.exe-style flags and can replace cl.exe in most MSBuild/CMake projects.

REM Install: part of LLVM Windows release or VS "LLVM" component

REM Basic usage (MSVC-style flags)
clang-cl /O2 /std:c++17 /MD src.cpp /Fe:prog.exe

REM Pass Clang-native flags with /clang:
clang-cl /O2 /clang:-Rpass=inline src.cpp /Fe:prog.exe

REM Use in CMake
cmake -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ..

Minimum Clang version for MSVC STL compatibility: Clang 8+. For C++20 features with MSVC STL: Clang 14+.

Source: https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild

5. PDB files and debugging

REM Compile with /Zi (external PDB) and /Fd (PDB name)
cl /Zi /Fd:prog.pdb /O2 src.cpp /link /DEBUG

REM /Z7: debug info embedded in .obj (no separate PDB for objects)
cl /Z7 /O2 src.cpp /link /DEBUG /PDB:prog.pdb

For WinDbg or VS debugger, ensure the PDB is alongside the executable or set the symbol path.

6. Common LNK errors

ErrorCauseFix
LNK2019: unresolved externalMissing .libAdd library in project settings or /link foo.lib
LNK2038: mismatch detected for 'RuntimeLibrary'Mixed /MT and /MDUnify all to /MD or /MT
LNK1104: cannot open file 'foo.lib'Library not in search pathAdd path via /LIBPATH: or LIB env var
LNK2005: already definedMultiple definitionsUse __declspec(selectany) or check for duplicate definitions
LNK4098: defaultlib 'LIBCMT' conflictsRuntime mismatchExplicitly pass /NODEFAULTLIB:LIBCMT or unify runtimes

7. Useful cl.exe flags

REM Preprocessed output
cl /P src.cpp       # produces src.i

REM Assembly output
cl /FA /O2 src.cpp  # produces src.asm (MASM syntax)
cl /FAs             # interleave source + asm

REM Show include files
cl /showIncludes src.cpp

REM Compiler version
cl /?  2>&1 | findstr /i "version"

For flag details, see references/flags.md.

Related skills

  • Use skills/compilers/clang for clang-cl's Clang-native diagnostics
  • Use skills/build-systems/cmake for CMake toolchain configuration on Windows
  • Use skills/debuggers/lldb or WinDbg for debugging MSVC-built binaries

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.94%
按下载量换算334

Claude

26.96%
按下载量换算243

Cursor

20.01%
按下载量换算181

Gemini CLI

9.28%
按下载量换算84

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills