EnterGCC -- versionYou can view the GCC version. GCC is in LinuxC LanguageCompiler.
You can run the commandLs/lib/libc -*View the so file and observe the Lib library version.
Generally, we use VI or Vim to edit the C language source file. Pay attention to W command disk storage and Q exit. You can save the file name in the filename mode.
// File Name: Test. c
// Compilation Method: GCC test. C-o myfirst
# Include < Stdio. h >
Int Main ( Int Argc, Char ** Argv)
{
Printf ( " Hello, Linux C. \ n " );
Return 0 ;
}
But when you find that the <stdio. h> file is missing during compilation, you willLs/usr/includeCheck if there is any stdio. H,
OrFind/usr/include-name 'stdio. H'Check whether stdio. h exists. You cannot find stdio. Therefore, printf cannot execute it!
The reason is that although you already have the GCC and Lib libraries, the header file developed by Dev does not: RunSudo apt-Get install build-essentialSolve the problem!
This will installDpkg-dev G + + libc6-dev libstdc ++ 6 Linux-libc-dev patchSoftware, through apt-get, you have noticed that I use Debian/ubuntu.
RunGCC test. C-o myfirstCompileProgram, And thenLs-lThe executable file of myfirst is generated../MyfirstExecute the program.
Note that the current directory is not searched in Linux, so you must explicitly specify the path./myfirst
Congratulations, your first Linux program is OK.