Home > Backend Development > C++ > Visual Studio and MSBuild

Visual Studio and MSBuild

Susan Sarandon
Release: 2024-12-14 16:25:11
Original
131 people have browsed it

Visual Studio and MSBuild

Visual Studio - development for executing programs and files in code and library assembly mode.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
</Project>
Copy after login

Using the example of the implemented file with the extension .vcxproj, we see the structure that MSBuild will assemble in a certain order.

<ItemGroup>
    <ClCompile Include="AssemblyInfo.cpp" />
    <ClCompile Include="stdafx.cpp">
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
    </ClCompile>
    <ClCompile Include="UnitTest.cpp" />
  </ItemGroup>
Copy after login
  1. Various levels of abstraction, like , determine the order in which the compiler is built and configured when running code
  2. Xml structure, .vcxproj.filters, .vcxproj.usernot only reserves space on the hard drive, but also, similar to Docker, allocates a container for the executable file, backing up changes
  3. The scheme involves specifying a specific assembly with a file path on the Microsoft website xmlns="http://schemas.microsoft.com/developer/msbuild/2003

Different mobile operating systems (Android/iOS) have different executable program engines. Likewise, when launching VS, we take into account the environment and typing of our structures.

<ItemGroup>
    <ClInclude Include="stdafx.h">
      <Filter>Header files</Filter>
    </ClInclude>
    <ClInclude Include="resource.h">
      <Filter>Header files</Filter>
    </ClInclude>
    <ClInclude Include="..\..\RootFinder\RootFinder\RootFinder.h">
      <Filter>Header files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="app.rc">
      <Filter>Resource files</Filter>
    </ResourceCompile>
  </ItemGroup>
  <ItemGroup>
    <Image Include="app.ico">
      <Filter>Resource files</Filter>
    </Image>
  </ItemGroup>
Copy after login

We explicitly list the classes of files involved in the assembly and the name with extension. This starts filtering project objects, classified by executable folders.

The above is the detailed content of Visual Studio and MSBuild. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template