2

I have created a large Visual C++ 10.0 project which builds nicely within the visual studio ide as well as within the "special" Visual Studio Command Prompt using msbuild with a vcxproj file.

However this project needs to be compiled by computers that do not have the vs ide, but only have the msbuild tool and the vc++ 10.0 runtime files.

The problem is that the vcxproj (created by the vs ide) file contains references to files such as Microsoft.Cpp.Default.props and Microsoft.Cpp.targets which clearly won't be available in a computer without visual studio.

Since all the compile and link command line options are available and fixed (no changes will be necessary), how is it possible to create a new vcxproj file to implement the compiling and linking of the project using these options?

niels
  • 760
  • 8
  • 24
  • It is very unlikely that you'll have *all* the required build tools when you have a machine without VS installed. You probably only got the .NET tools. The msvc runtime files are only useful when running the built program. The VS license allows you to install it on more than one machine, as long as you don't use them at the same time. – Hans Passant Oct 29 '11 at 11:40
  • It is explicitly said by microsoft that it is possible to build a vc proj file on a computer without vs. There are certain articles on the internet that construct simple proj files and do the build only using msbuild. The problem here is that my project is fairly complicated and I can't construct a proj file by hand from scratch – niels Oct 29 '11 at 16:40
  • Your question resolves to how to install msbuild. See [this previous answer](http://stackoverflow.com/questions/2567018/installing-msbuild-4-0-without-visual-studio-2010/3632656#3632656) for a SO discussion of this topic. – patthoyts Oct 29 '11 at 09:16
  • Are you implying that `Microsoft.Cpp.Default.props`and `Microsoft.Cpp.targets` files will be present in a computer with msbuild (but not vs) installed? If that is true then there is no problem but is it really true? – niels Oct 29 '11 at 09:22
  • I would check to see if these might also get installed with the Windows SDK (formerly known as platformSDK) – Ben L Jan 17 '12 at 21:31

2 Answers2

9

I was finally able to make some tests on a "clean" computer. These are the results:

First, I installed .NET Framework 4.0 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17718. Along with it, MSBuild 4.0 was also installed automatically. When I tried to compile I got the following error:

error MSB4019: The imported project "H:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

which means that extra files are needed to compile the vcxproj and these files were missing. Note that simple project files written by hand (and not by the VS IDE) are expected to compile without problems since they contain no references to theses files (I did not test it for certain).

Next, I installed Windows SDK 7.1 from http://www.microsoft.com/download/en/details.aspx?id=8442. The error about missing files disappeared, but I got a new one. This new error (along with the way I overcomed it) is described in http://www.damirscorner.com/CommentView,guid,9121bd6b-876c-4051-8487-de1b95a7e919.aspx.

Doing the above successfully allowed me build my vcxproj file on a computer without vs2010.

niels
  • 760
  • 8
  • 24
1

I think that the files that you mention are not part of Visual Studio. They are part of MSbuild.