For Windows, compile and connect the C/C ++ source code method in the command line, and use the command line source code.

Source: Internet
Author: User

For Windows, compile and connect the C/C ++ source code method in the command line, and use the command line source code.

How to compile the Connection source code in Windows:
Cl-GX test. c
-GX: Start synchronization Exception Handling
The above command will generate an executable program: test.exe
Enter test.exe in the command line to run the program.


Tips:
If you click "cl.exe" in the "one-click" dialog box, the cl.exe program cannot be found. The solution is as follows:
Add the system variable (Path), such as my computer-> properties-> advanced-> environment variable-> system variable, add
C:/Program Files/Microsoft Visual Studio 9.0/VC/bin ;.
Note:
1. Separate them with ";" at the end!
2. If your Microsoft Visual Studio is earlier than version 9.0 or later than version 9.0, modify the path name above.


2. The mspdb80.dll cannot be found when cl is typed in cmd during compilation, because there is no "msobj80.dll" under VC/Bin,
The solution is as follows:
1> copy the four files directly from Common7/IDE/to VC/Bin /.
2> Add the system variable (Path). In this way, choose my computer> Properties> advanced> environment variable> system variable, and add C: /Program Files/Microsoft Visual Studio 8/Common7/IDE; note that the end is separated!
In this way, the mspdb80.dll file cannot be found during cl compilation.


3. If an error occurs during compilation:
1. fatal error C1034: stdio. h: no include path set
2. fatal error LNK1104: cannot open file "kernel32.lib
Choose my computer> Properties> advanced> environment variables> system variables to create system variables LIB and INCLUDE and set their values:
(LIB) C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib; C:/Program Files/Microsoft SDKs/Windows/v5.0/Lib; C: /Program Files/Microsoft Visual Studio 9.0/VC/lib
(INCLUDE) C:/Program Files/Microsoft Visual Studio 9.0/VC/include

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.