msvc-cl

Translate GCC/Clang compiler flags to MSVC equivalents for Windows C/C++ builds.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill msvc-cl-awfixers-stuff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: msvc-cl
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/msvc-cl
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill msvc-cl-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill removes the friction of configuring and diagnosing Windows C/C++ builds by translating GCC/Clang flags to MSVC equivalents, advising runtime library choices, guiding PDB generation, and helping resolve common MSVC linker errors.

Core Features & Use Cases

  • Flag translation: Maps common GCC/Clang options to cl.exe/clang-cl equivalents and explains linker- vs compiler-stage flags.
  • Runtime library guidance: Explains /MD vs /MT choices, the cause of runtime mismatches, and how to unify CRT linkage to avoid LNK2038 and related issues.
  • clang-cl and toolchain integration: Shows how to use clang-cl with MSBuild and CMake, compatibility considerations for STL and Clang versions, and LTO/LTCG usage.
  • Debugging and PDBs: Advises on /Zi, /Z7, /Fd, linker /DEBUG options, and symbol placement for VS and WinDbg scenarios.
  • Use case: When a Windows build produces unresolved externals or defaultlib conflicts, use this Skill to find mismatched runtimes, missing libraries, and the correct MSVC flags to fix the build.

Quick Start

Ask the msvc-cl skill to translate a list of GCC/Clang flags to MSVC equivalents and diagnose any linker errors for a Visual Studio or CMake Windows project.

Frequently Asked Questions about msvc-cl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate GCC and Clang compiler flags to MSVC equivalents for a Windows build?▼

To translate GCC and Clang flags to MSVC equivalents, map the options to cl.exe or clang-cl syntax while distinguishing between compiler-stage and linker-stage flags. This ensures the Windows C/C++ build receives the correct flag equivalence for Visual Studio, MSBuild, and CMake toolchains.

Why does my MSVC build produce LNK2038 and defaultlib runtime mismatch errors?▼

MSVC linker errors like LNK2038 occur from runtime library mismatches when mixing /MD and /MT flags. Unify CRT linkage across all dependencies to resolve defaultlib conflicts and unresolved externals, ensuring consistent dynamic or static runtime selection.

Can I use clang-cl with CMake and MSBuild instead of the standard cl.exe compiler?▼

Yes, you can use clang-cl with CMake and MSBuild instead of cl.exe. clang-cl provides compatibility with the MSVC toolchain, requiring attention to STL and Clang version compatibility to maintain correct compilation and LTO/LTCG usage.

How do I configure PDB generation and debug symbols for a Visual Studio CMake build?▼

PDB generation in MSVC requires configuring /Zi or /Z7 for debug information and /Fd for symbol file placement. Combine these with the linker /DEBUG option to generate symbols correctly for debugging scenarios in Visual Studio and WinDbg.

What is the difference between /MD and /MT runtime libraries when configuring Windows C++ projects?▼

The difference between /MD and /MT runtime libraries is dynamic versus static CRT linkage. /MD links the C runtime dynamically while /MT links it statically; choosing incorrectly causes defaultlib conflicts and linker errors requiring unified runtime selection.

How do I fix unresolved externals and missing library errors in my MSVC build?▼

To fix unresolved externals in MSVC builds, diagnose missing libraries and mismatched runtimes by checking flag mappings. Identify whether the issue stems from runtime library inconsistency or missing dependencies to apply the correct MSVC flags.