Under the Start menu you can find (my system is WIN10):D eveloper Command Prompt for VS2015. The target file for the shortcut is VS2015 in the installation directory Vsdevcmd.bat, here D:\VS2015 is my installation directory.
Create the test Code E:\VS_myproject\ command line \hello.cpp.
#include <stdio.h>
#include <iostream>
int main ()
{
Std::cout << "This is a C + + program." << Std::endl;
printf ("hello!\n");
Return 23;//test main return value
}
The D:\VS2015\VC\bin file has tools to compile and link to.
Cl.exe: Compiler program (reprint: http://blog.csdn.net/luoweifu/article/details/49847749)
Link.exe: Linking Programs
Lib.exe: Program to load Lib library
Nmake.exe: Tools for building and compiling with makefile
Go to the directory where the CPP file is located and compile with the CL HELLO.CPP/EHSC command. (CL after character is lowercase l is not number 1)
Operation Result:
Visual Studio 2015 Command-line compilation of C + + programs