msvc-build
Skill22 starsChanged 7 months agoMITView on GitHub
Use when compiling MSVC C++ projects, debugging build errors, or performing clean and incremental builds
In this repository17 other files it gives its agents.
- code-analysisSkill
- code-generatorSkill
- contributingSkill
- daily-logSkill
- devflowSkill
- git-workflowSkill
- hexo-blog-updateSkill
- kimicode-vision-bridgeSkill
- knowledge-base-cacheSkill
- layered-first-principles-teachingSkill
- mvp-designSkill
- paper-first-principlesSkill
- requirement-clarificationSkill
- research-to-practiceSkill
- taskmaster-skillSkill
- ue5-umgSkill
- unity-mcpSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use this skill when you need to:
- Very specific: line 33
Check PATH for msbuild.exe
- Distinctive: line 34
Search standard VS2019/2022 installation paths
- Distinctive: line 145
Use Developer Command Prompt for Visual Studio
- Distinctive: line 163
Use Visual Studio IDE (handles include paths correctly)
- Distinctive: line 164
Ensure Property Sheets (.props) are imported
- Distinctive: line 165
Check AdditionalIncludeDirectories in project settings
- Very specific: line 175
Ensure first line of .cpp file is #include "StableHeaders.h" (or project's PCH header)
- Distinctive: line 176
Check Precompiled Header settings in project properties
- Distinctive: line 186
Check Additional Dependencies in Linker settings
- Distinctive: line 187
Ensure required .lib files are built
- Distinctive: line 188
Verify __declspec(dllexport/dllimport) macros for DLLs
- Very specific: line 202
Start with minimal verbosity: - Use /v:m, increase only when debugging
- Very specific: line 203
Clean build after major changes: - Delete Debug/ or Release/ folders
- Very specific: line 205
Check Property Sheets: - Ensure .props files are correctly imported
- Very specific: line 209
Never modify .vcxproj files directly without backups
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MSVC Build Skill
Overview
This skill provides guidance for compiling and building Microsoft Visual C++ projects using MSBuild, with intelligent error detection and resolution suggestions.
When to Use
Use this skill when you need to:
- Compile C++ projects in Visual Studio solutions (.sln)
- Build individual project files (.vcxproj)
- Debug compilation errors
- Perform incremental or clean builds
- Compile with specific configurations (Debug/Release, Win32/x64)
Prerequisites
- Visual Studio 2019/2022 installed
- MSBuild available in PATH or at standard location
- Project solution (.sln) or project file (.vcxproj)
Workflow
Step 1: Detect Build Environment
Automatically locate MSBuild:
- Check PATH for
msbuild.exe - Search standard VS2019/2022 installation paths
- Report MSBuild version and location
Step 2: Analyze Project Structure
Identify:
- Solution file (.sln) location
- Project dependencies
- Available configurations (Debug/Release)
- Available platforms (Win32/x64)
Step 3: Execute Build
Full Solution Build:
MSBuild Solution.sln /p:Configuration=Debug /p:Platform=Win32 /mSingle Project Build:
MSBuild Solution.sln /t:ProjectName /p:Configuration=Debug /p:Platform=Win32 /mIncremental Build (faster):
MSBuild Project.vcxproj /p:Configuration=Debug /p:Platform=Win32Clean Build:
MSBuild Solution.sln /t:Clean
MSBuild Solution.sln /p:Configuration=Debug /p:Platform=Win32 /mStep 4: Error Analysis
Parse MSBuild output and categorize errors:
| Error Type | Pattern | Suggestion |
| Missing include | C1083: Cannot open include file | Check include paths, verify file exists |
| Undeclared identifier | C2065: 'X': undeclared identifier | Check header includes, verify declaration |
| Syntax error | C2143, C2061 | Check syntax, missing semicolons |
| Type undefined | C2027: use of undefined type | Forward declaration or missing include |
| Link error | LNK2019, LNK2001 | Check library dependencies, export macros |
| Precompiled header | C2857, C1853 | Ensure #include "StableHeaders.h" first |
Build Commands Reference
Basic Build
# Debug Win32 (most common for development)
MSBuild Project.sln /p:Configuration=Debug /p:Platform=Win32 /m
# Release Win32
MSBuild Project.sln /p:Configuration=Release /p:Platform=Win32 /m
# Debug x64
MSBuild Project.sln /p:Configuration=Debug /p:Platform=x64 /mTargeted Build
# Build specific project only
MSBuild Project.sln /t:WorldServer /p:Configuration=Debug /p:Platform=Win32
# Build multiple specific projects
MSBuild Project.sln /t:LibClient;Network;Common;WorldServerVerbosity Levels
# Quiet - only errors
/v:q
# Minimal - errors and warnings (default)
/v:m
# Normal - standard output
/v:n
# Detailed - verbose output
/v:d
# Diagnostic - maximum detail
/v:diagParallel Build
# Use all processors (recommended)
/m
# Use specific number of processors
/m:4Common Issues and Solutions
Issue 1: MSBuild Not Found
Error:
The term 'msbuild' is not recognizedSolution:
- Use Developer Command Prompt for Visual Studio
- Or provide full path to MSBuild:
- VS2022:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe - VS2019:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
- VS2022:
Issue 2: Missing Include Files
Error:
error C1083: Cannot open include file: 'Serialization/OutStream.h'Causes:
- Missing AdditionalIncludeDirectories in .vcxproj
- Using command-line without proper environment setup
- Relative path errors in #include statements
Solutions:
- Use Visual Studio IDE (handles include paths correctly)
- Ensure Property Sheets (.props) are imported
- Check AdditionalIncludeDirectories in project settings
Issue 3: Precompiled Header Errors
Error:
error C2857: #include statement specified with the /Ycstdafx.h command-line option was not foundSolution:
- Ensure first line of .cpp file is
#include "StableHeaders.h"(or project's PCH header) - Check Precompiled Header settings in project properties
Issue 4: Link Errors
Error:
error LNK2019: unresolved external symbolSolutions:
- Check Additional Dependencies in Linker settings
- Ensure required .lib files are built
- Verify __declspec(dllexport/dllimport) macros for DLLs
Integration with VS IDE
Running from IDE
- Open
.slnfile in Visual Studio - Select configuration from toolbar (Debug/Release, Win32/x64)
- Build → Build Solution (Ctrl+Shift+B)
- View errors in Error List window (Ctrl+, E)
Best Practices
- Always use /m for parallel builds - Significantly faster on multi-core systems
- Start with minimal verbosity - Use
/v:m, increase only when debugging - Clean build after major changes - Delete
Debug/orRelease/folders - Build dependencies first - Core libs → Network → Common → Executables
- Check Property Sheets - Ensure
.propsfiles are correctly imported
Safety Notes
- Never modify
.vcxprojfiles directly without backups - Property Sheets (.props) changes affect multiple projects
- Precompiled header changes require full rebuild
- Be cautious with compiler warnings treated as errors
Example Session
User: Compile WorldServer project in Debug Win32
Agent:
📋 Build Plan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Solution: Project/Server/Project.sln
Target: WorldServer
Configuration: Debug | Win32
Parallel: Yes (/m)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Finding MSBuild...
✓ Found: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
Version: 17.14.40
Executing build...
MSBuild Project.sln /t:WorldServer /p:Configuration=Debug /p:Platform=Win32 /m /v:minimal
Build Results:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ LibClient.lib
✓ Network.lib
✓ Database.lib
✓ Common.lib
✓ WorldServer.exe
Build succeeded with 0 errors, 3 warnings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Limitations
- Cannot fix source code errors automatically
- Cannot modify project dependencies
- Cannot resolve missing third-party libraries
- Large solutions may require IDE for full context
See Also
- Microsoft MSBuild documentation: https://docs.microsoft.com/visualstudio/msbuild/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

