The previous few days in preparation for the CENTOS7 under the compilation environment, the online installation of GCC and gcc-c++ is very simple, as long as the machine is networked in the terminal window in order to enter separately1 Yum Install gcc 2 Yum install gcc-c++The installation can be completed online, and t
Install the GCC compiler and the GCC compiler1. Introduction to GCC
GCC (GNU Compiler Collection) is a powerful and superior programming language Compiler. It is one of the representative works of the GNU program. GCC is the most commonly used Compiler in Linux.
C language compilation process and GCC compilation parameters, gcc compilation Parameters
C language compilation generally involves three steps:
Gcc-E-o a. e a. c
Pre-compile the. c file. The generated target file name is a.e.
Pre-compilation is to replace the header file content contained in include with the C file, and delete unused comments in the code.
Exampl
No Internet access, the use of CD-ROM installation of GCC and gcc-c++ method is as follows:
First put the CD into the optical drive, the virtual machine in the words on the ISO CD image can be.
And then the following:
[Root@localhost ~]# more gcc_install.sh
#!/bin/bashMount/dev/cdrom/mntcd/mnt/centos/RPM-IVH glibc-common-2.5-42.i386.rpmRPM-IVH kernel-headers-2.6.18-164.el5.i386.rpmRPM-IVH libgcc-4.1.2-46.el
Objective:GCC was formerly the GNU C language compiler (GNU C Compiler) because it could only handle the C language. GCC expands quickly to become able to handle C + +. and thenExtensions can support more programming languages such as FORTRAN, Pascal, Objective-c, Java, Ada, go, and assembly language on a variety of processor architectures, so changingGNU Compiler Suite (GNU Compiler Collection). (Baidu Encyclopedia, want to know their own query)A The
What is the difference between arm-linux-gcc and arm-elf-gcc? embedded basic series-general Linux technology-Linux programming and kernel information. For more information, see the following. How can we explain the differences between arm-linux-gcc and arm-elf-gcc in one sentence?
Arm-linux-
Brief introductionSome of the software is newer and requires a higher GCC version, so you need to upgrade GCC. Compiling and installing is time consuming, so it is good to choose bin package directly.StepsAdd source1 sudo add-apt-repository ppa:ubuntu-toolchain-r/test2sudo apt-get updateInstall dependent packages (this is required if an error occurs)1 sudo Install Software-properties-commonUpgrade Installat
First, confirm that the GCC and make packages have been installedYou can use the Whereis command to view:If the Whereis gcc and whereis make commands have results, you can continue to do so by installing both software.Second, use GCC compile to run a HelloWorld program (only involves a single file)You can write a C program in any directory and then compile and ru
Common gcc/g ++ commands and gcc Command Options
Common options for gcc/g ++ commands (option description)
-O FILE specifies the output FILE name. This option is not required during compilation of the target code. If FILE is not specified, the default FILE name is a. out.
-C: only compile and generate the target file without Link
-Msung optimizes code for 486.
-O
-o0
-o1
-o2
-o3
4 levels of compiler optimization options,-o0 means no optimizations,-o1 defaults,-O3 optimization level most (here is Capital letter O)
Optimization Options (Source: http://blog.csdn.net/Sodier/article/details/452566)
This part of the content can be divided into two parts, part of this is to have the compiler analyze the code, and the other part is that we can make some information about the hardware for the compiler, and let him generate better code for the hardware, and we h
arm-linux-gcc Cross compiler and gcc compiler download address1. ARM-NONE-LINUX-GNUEABI-GCC compiler
ARM-NONE-LINUX-GNUEABI-GCC is the arm cross-compilation tool launched by Codesourcery (which has been acquired by mentor) based on GCC. Code that can be used to cross-compile
GCC program compilation and gcc Compilation1. Introduction
GCC program compilation can be divided into four stages:
Preprocessing (Pre-Preocessing)
Compile (Compiling)
Assembly)
Link (Linking)
2. Basic GCC usage
Basic usage:Gcc [options] [filename]Common options selection and usage are described as f
Method 1: # pragma pack (n)
Using the pseudo command # pragma pack (n), the compiler will align according to n Bytes;Use the pseudo command # pragma pack () to cancel the custom byte alignment.If the value of n specified in # pragma pack (n) is greater than the size of the maximum member in the structure, the structure still performs Bounds Based on the largest member in size.
Note: This method is added in gcc 4. At least
Use the _ attribute _ of gcc to compile the attribute section sub-item to construct the initialization function table. The gcc _ attribute _
This article forwarded from: https://my.oschina.net/u/180497/blog/177206
It solves song Baohua's previousC language object-oriented (for larger software) ppt sharing and ppt annotationsMulti-module software initialization
Gcc's _ attribute _ compilation attribute has
to set up Yum source.After installing CentOS, it is generally necessary to modify the Yum source to achieve the desired speed when installing the update RPM package. Domestic relatively fast has 163 source, Sohu source. Here is an example of a 163 source.1. CD/ETC/YUM.REPOS.D2. MV Centos-base.repo Centos-base.repo.backup3. wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo4. MV Centos6-base-163.repo Centos-base.repo5.yum Clean AllThis article is from the Linux learning blog, so be sure to
Download: http://ftp.gnu.org/gnu/gcc/gcc-4.5.1/gcc-4.5.1.tar.bz2Browse: HTTP://FTP.GNU.ORG/GNU/GCC/GCC-4.5.1/View Changes:http://gcc.gnu.org/gcc-4.5/changes.htmNow many programmers are using G
When developing applications for Linux, the C language is used in most cases. Therefore, almost every Linux programmer is faced with a primary problem.Flexible use of the C compiler. Currently, the most common C language compiler in Linux is GCC (GNU Compiler Collection), which complies with ansi c in the GNU project.The standard compilation system can compile programs written in C, C ++, Object C, and other languages.
Installing GCC under Ubuntu is a bit different from some other Linux systems.
First, installation method one:
sudo apt-get build-dep gccMethod Two:
sudo apt-get install build-essentialAfter installation, you can perform the following commands to view the version.
GCC--versionThe output is as follows:
GCC (GCC
preparatory work
Download and unzip the GCC source pack
Download a GCC source package from HTTP://FTP.GNU.ORG/GNU/GCC that you want to compile. For example, download is gcc-4.7.2.tar.bz2, and then use the input decompression command TAR-XVF 4.7.2.tar.bz2
To install the required libraries
When you use the./configure co
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.