Tag: Use error to open GCC code format err dev C language
C Language Lesson Two:
Octal 0 0370
Hex 0x (case insensitive) 0xe3d
ASCII code:
ASCII code specifies 128 English characters and binary correspondence, occupies one byte (actually occupies only one byte of the back 7 bits, the first 1 is uniform 0)
Unicode:
Unicode is a large collection that now scales to accommodate the 100多万个 symbol, and the corresponding binary for each symbol is different. Unicode rules can use multiple bytes to represent a character, such as A's encoding of 01100001, one byte is enough, and the "good" encoding is 01011001 01111101, which requires two bytes.
In order to be compatible with Ascii,unicode, the first 0~127 characters are the same as the ASCII, but not the same as the 128~255.
Compile:
Generate the source file for the destination file.
Link:
Combine the target file with the system library and convert it into an executable file.
VC++6.0 's Engineering directory structure Description:
1). dsp File: Developerstudio project, project file (text format), used to save information about the current project, such as compilation parameters, included source files, etc., is not recommended for manual editing. When you need to open a project, open the file.
2). dsw file: Developerstudio Workspace, workspace file, similar to DSP.
3). opt file: IDE's option file, which preserves the configuration of the development environment related to the current project, such as the location of toolbars, open files, cursor positions, and so on.
4). plg file: A log file (HTML file) that stores compile information for the program, such as errors and warnings.
A project can contain multiple source files and resource files (pictures, videos, and so on), but only a single binary file, such as an executable program. EXE, a dynamic-link library. dll, a static link library. lib, etc. The project type determines the different configuration information and also determines the generation of a different binary file.
Note: Compiling the generated. exe file is within the Debug folder of the project directory. You will also see a file named Hello.obj in the Debug directory. obj is the target file generated by Vc/vs, similar to the. o file under C-free.
ws[
Creating a project in VS creates the solution by default. The "solution" in VS and "workspace" in VC6.0 is a concept where solutions can contain multiple projects and can be generated in batches.
A workspace can contain multiple projects that can generate multiple binaries in batches.
Step into the compilation:
1) pretreatment
GCC-E Test.c-o test.i
In the current directory will be more than a preprocessing result file test.i, open test.i can see, on the basis of test.c stdio.h and stdlib.h the contents of the inserted.
2) Compile as assembly code
Gcc-s Test.i-o Test.s
Where-s parameter is exited after compilation is complete,-O is the specified file name.
3) assembly as the target file
Gcc-c Test.s-o TEST.O
. O is the target file. The target file is similar to an executable file, which is the executable code that the machine recognizes, but the structure is slightly different because there are no links.
4) Link and generate the executable file
GCC Test.o-o Test
If you have more than one source file, you can compile it like this:
Gcc-c Test1.c-o TEST1.O
Gcc-c Test2.c-o TEST2.O
GCC test1.o test2.o-o Test
Note: If you do not specify a filename, GCC generates a file named A.out. out file only to differentiate the compiled file, Linux does not have the standard executable suffix name, the general executable file does not have the suffix name.
The test file generated after compilation is the program, run it:
./test
If you do not have permission to run, you can use the sudo command to increase the permissions (note the Linux partition):
sudo cdmod test 777
We can use the-pedantic,-wall,-werror options for the program's error checking:
The-pedantic option helps programmers discover some code that does not conform to the Ansi/iso C standard (not all);
-wall allows GCC to display warning messages;
-werror can stop GCC from continuing when it encounters an error in the compilation.
These 3 options are very useful.
C Language Lesson Two