次のメインはmsbuildを介してコンパイルしたい
#include <stdio.h>
int main (int argc, char *argv[])
{
char Buffer[2000];
printf("TEST");
gets(Buffer);
}
バッチファイルはmsbuildを呼び出します。
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild main.vcxproj
pause
msbuildプロジェクトファイルは次のとおりです。
<?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>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
</Project>
セットアップ全体はこれまでのところ機能しますが、msprojectファイルについてさらに学ぶのに役立つ適切なソースを見つける必要があります。複数のことを学びたい。どうやって:
- 「インポート」オプションを取り除き、インポートされたパーツを自分で定義します
- コマンドラインパラメータを使用してファイルのセットをコンパイルします...(%param%.c%param%TEST.c、...)
- プロジェクトファイルを使用して、プログラムをすぐに起動します(%param%Test.exe)。
- 複数のターゲットをコンパイルします...リリース、デバッグなど
- コンパイル後にコピー:Subproject / release /%param%.obj-> c:\ AccurateVersion \%param%.obj
- 再構築する前に清掃してください