Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:32:36+00:00 2026-06-15T00:32:36+00:00

The following main wants to be compiled via msbuild #include <stdio.h> int main (int

  • 0

The following main wants to be compiled via msbuild

#include <stdio.h>

int main (int argc, char *argv[])
{
    char Buffer[2000];
    printf("TEST");
    gets(Buffer);
}

A Batch file calls msbuild:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild main.vcxproj
pause

The msbuild project file is as follows.

<?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>

The whole setup works so far but i need to find a good source to help me learn more about msproject files.
I want to learn multiple things. How can I:

  • get rid of the “Import” oprtions and define the imported parts myself
  • use a commandline parameter to compile a set of files… ( %param%.c %param%TEST.c ,…)
  • use the projectfile to launch programs immediatelly ( %param%Test.exe )
  • compile multiple targets,… release, debug, etc
  • copy after compiling : Subproject/release/%param%.obj -> c:\accurateVersion\%param%.obj
  • Clean before rebuilding
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:32:37+00:00Added an answer on June 15, 2026 at 12:32 am

    There is a great book with lots of sample code to do everything you are talking about.

    Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build

    Here is how you can call clean and then the build targets and also have it compile the the debug and release configurations.
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild main.vcxproj /t:clean;build /p:Configuration=Debug;Release /p:platform=Win32

    The copy task:

    <ItemGroup>
        <MySourceFiles Include="c:\MySourceTree\**\*.*"/>
    </ItemGroup>
    
    <Target Name="CopyFiles">
        <Copy
            SourceFiles="@(MySourceFiles)"
            DestinationFiles="@(MySourceFiles->'c:\MyDestinationTree\%(RecursiveDir)%    (Filename)%(Extension)')"
     />
    

    This link might help you with some of your other questions.

    Walkthrough: Using MSBuild to Create a Visual C++ Project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c program #include <stdio.h> int main () { printf(Hello); } On
I've got a c++ app, with the following main.cpp: 1: #include <stdio.h> 2: #include
I have the following source code : // main.cpp #include a.h int main() {
Here is my server program #include<stdio.h> #include<stdlib.h> #include<sys/socket.h> #include<sys/un.h> #include<sys/types.h> #include<unistd.h> int main ()
I've written a program of the following form: #include stuff_I_need.h int main(){ construct_array(); //
There is such code: #include <cstdlib> #include <clang-c/Index.h> using namespace std; int main(int argc,
Example: For(int i=0; i<4; i++) playSound(Sound.wav); I have the following classes: Main import java.io.IOException;
Consider the following code: int main() { int *p; ++((int){5}); //compile without err/warning &((int){5});
I want to execute python code from C# with following code. static void Main(string[]
Suppose I have two tables Main and Other like the following: Main +----------+-----------------------------------+ |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.