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