How to use the cmd command in Windows to compile, run C + + programs

Source: Internet
Author: User

Download VC6.0, install after download.

1. Modify Environment variables
In System Properties-advanced-environment variables-User variables:
① edit path adds the paths to the CL compiler D:/program Files/microsoft Visual Studio 10.0/vc98/bin and MSPDB60.DLL paths D:/program

Files/microsoft Visual Studio 10.0/common/msdev98\bin, separated by semicolons.

② new variable Include:d:/program files/microsoft Visual Studio 10.0/vc98/include
③ new variable Lib:d:/program files/microsoft Visual Studio 10.0/vc98/lib

2, run cl in command Prompt (CMD), if error prompt link:fatal error LNK1104: Unable to open file "Kernel32.lib", C:/Program Files/microsoft

The kernel32.lib copy under the Sdks/windows/v7.0a/lib directory to the D:/program files/microsoft Visual Studio 10.0/vc/lib directory.

3. Try the effect, enter CL in cmd

If the content is displayed, the editor installation succeeds.

Microsoft (R) 32-bit/C + + optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
USAGE:CL [option ...] filename ... [/link linkoption ...]

4, this time to compile, execute your C + + program.

For example:

CL Test.cpp (generates: Test.obj and Test.exe)

Test.exe + Enter

You can see the results in CMD.

Http://www.cmdmingling.com/post/661.html


How to use the cmd command in Windows to compile, run C + + programs

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.