use msbuild to compile a vcxproj created by vs2010 on a computer without vs - c++

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?

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.

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

Related

compiling c++ projects with sln file in ubuntu

This may be a stupid question, but I've been trying to compile a larger project that was originally associated with visual studio in Ubuntu. I settled on cmake to do this, but it needs a cmakelist file. As I don't want to set this up manually, since I'll have to port several thousand pages like this, is there a way to have cmake read the sln files visual studio generates?
Any way that would let me compile the projects automatically on Ubuntu would be great.

Visual Studio 2017 Linux remote build - recompiling all cpp files on each build

I am using Visual Studio 2017 Community to develop application that is built on remote Linux machine (exactly Raspberry Pi 3). I have created a new project using Visual Studio's Raspberry Pi project template.
The problem is: even when I just change one line of code, the entire bunch of cpp files is rebuilding. My project consists 100+ source files and building time is reaching 10-20 minutes. It is really painful.
How can I change it, so building will only take place on changed file?
My guess is that you have a lot of includes in your header files. Try to move as many of them as possible to the cpp files.
The problem was MSBuild bug - see github.com/Microsoft/VSLinux/issues/29
Changing MSBuild to CMake solved all problems.

How to compile and build librsync using visual Studio 2010?

We have a requirement where we need some rsync library.I came across something named as librsync and downloaded it from this Link
In the readme file of this library its mentioned
The PCbuild directory contains a project and pre-generated config
files for use with the MSVC++ IDE. This should be enough to compile
rdiff.exe without requiring cygwin.
But when I opened it in MSVC++ IDE and built it,it gave me more than 36 compile time errors.I guess I'm doing something wrong or missing some important steps to do it.
I am using MS Visual Studio 2010 premium on windows 7 PC.
Please help in case anyone here has successfully ran this project library using visual studio 2010.
After opening the .dsw VC++ 6 workspace file with VS2010 and using the automatic project conversion, I had to make the following minimal changes to get it to compile:
Added #define inline __inline to the bottom of PCbuild\config.h. VS2010 doesn't support the inline keyword for C, but does have __inline.
Added HAVE_CONFIG_H to rdiff Project Properties, C/C++, Preprocessor, Preprocessor Definitions. Otherwise, the project wasn't using the pre-built PCbuild\config.h in some cases. Right-click the rdiff project, select Properties and make the changes in the dialog below:
Added rollsum.c to the rdiff Source Files list. Not sure why this got dropped from the conversion, but it was needed to compile.
There were still 72 warnings, and I didn't test the result, but that should help you get started.

How to generate Qt .pri files from Visual studio project at the end of the build?

Can I setup my solution in visual studio to automatically generate the .pri files at the end of the build? I thought about perhaps writing a batch file to call a command to generate the .pri files, is it possible to generate .pri files from the command line?
I am working on a Qt C++ application in visual studio made up of 9 subprojects. I also created a QMake based build of the same application using Qt visual studio add in to generate the .pro and .pri files.
The setup is working well, and the application compiles successfully on Windows (using VS2010) and Mac OS X (Qt creator). The problem is that every time I change the projects in visual studio (for example by adding or removing source files), I have to manually regenerate the .pri file for the project so it gets picked up by qmake.
I'm using the Qt visual studio add in v1.1.11. Visual studio 2010, Qt 4.7.4.
I created a small python script to generate .pri files from visual studio .vcxproj.filter files, I've added it to our post build script that runs at the end of the visual studio build, and it seems to work quite well. If anyone else wants it, you can find it here:
https://github.com/JamesSmaldon/prigen.git
You know, Visual Studio is independent on Qt environment. The only opportunity to do what you want is use of some VS plugins, but I've never actually seen such an option anywhere.
As for me, when I add some file to VS solution, I append it manually to the *.pro file.

TInyXML++ Premake with Visual Studio 2010

I tried to compile TinyXML++(or TICPP) using premake4 with these settings: "premake4 vs2010 [--unicode] [--ticpp-shared] [--dynamic-runtime]". It compiles the .libs but I can't compile TiCPP.vcxproj because the compiler says "Unable to start program c:\ticpp\lib\ticpp.lib. This file is an unrecognized or unsupported binary file." Anyone got a clue how to make this work? Oh and one more thing, why does Windows ask me if I want to open a .vcxproj with Visual Studio 2010 or Visual Studio 10? How do I make it so that it only picks one, and what's the difference. I tried the first answer, but it didn't work.
Download last version of premake, it does support VS2010
I have compiled tinyXML++ using it, by executing:
premake4 vs2010
it does generate valid sln and vcxproj files.
From oolua build instructions
Visual Studio 2010 (vs10) is not currently supported by premake yet if you have vs10 installed you can run the following command, it will generate vs9 projects and update them using the vs10 command line tool.
premake4 vs2010
As vs10 adds files which have not been created directly by premake, a specific clean operation has been added to the premake script.
premake4 cleanVS10
Scripts to build a local install, build and run unit test etc. have been added for vs10 in the script directory.
Notes:
* oolua's premake4 script may not be the same as yours.
* VS2010 support is borked in premake. Current workaround is to make a 2008 project and make VS2010 convert it for you.