If you're compiling C++ on Windows or porting a GCC-based build to MSVC, this covers the essentials: translating optimization flags, choosing between /MT and /MD runtimes (the main source of LNK2038 errors), and using clang-cl as a drop-in replacement for cl.exe. The flag translation table alone saves you from hunting through MSVC documentation every time you need the equivalent of -O2 or -g. It also walks through vcvars setup, PDB generation, and diagnosing the usual linker mismatches. Honestly, the runtime library section should be required reading for anyone who's ever seen a "mismatch detected for RuntimeLibrary" error and wondered why their third-party library won't link.
- skills.sh installs
- 671
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill msvc-cl --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Category
- Design & UI/UX
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Fuzzing670
- Binutils665
- Linkers Lto663
- Conan Vcpkg659
- Dynamic Linking650
- Rust Security624
- Rust Ffi613
- Rust Unsafe611
- Pgo610
- Interpreters609
- Cargo Workflows608
- Rust Sanitizers Miri604
- Meson603
- Cpp Modules597
- Rust Debugging597
- Hardware Counters590
- Debug Optimized Builds579
- Cpp Templates574
- Rustc Basics567
- Rust Cross565
- Wasm Emscripten559
- Zig Debugging555
- Zig Build System552
- Zig Cross536
