Visual Studio 2015 Command-line compilation of C + + programs

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.