Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we build one visual studio project from commandline

I have a visual studio c test project (Helloworld project) created from VS 2008 professional edition and it contains VC++ project file.

May I know how can I build the same project from commandline(cmd) so that I wont need to take the VS GUI for building the same.

I am pretty comfused that it may need some make file to be created but I cannot see any option to create the ame in the visual studio said edition.

any suggestions or helps are much appreciated.

like image 720
Renjith G Avatar asked Oct 24 '25 04:10

Renjith G


2 Answers

You can drive the solution or project build using vcbuild or devenv. An example of the latter:

devenv Solution.sln /build /project Project.vcproj /projectconfig "Debug|Win32"

(You can run vcbuild /? and devenv /? to find their commonly used options.)

Note that in Visual Studio 2010 and later, Visual C++ projects use MSBuild, so projects can be built on the command line using msbuild, just like any other MSBuild projects (C#, VB, etc.). The older VCBuild, used in previous versions of Visual Studio, is no longer supported.

like image 160
James McNellis Avatar answered Oct 26 '25 19:10

James McNellis


This is typically done via nmake. VS60 allowed to export a makefile and use it with nmake(Microsoft's make utility) . (After than we started writing our own makefile).

http://msdn.microsoft.com/en-us/library/aa233950(v=vs.60).aspx

hopefully newer Visual Studio will have similar or better options.

like image 37
Jayan Avatar answered Oct 26 '25 17:10

Jayan