Installing GCC in Ubuntu is a little different from other Linux systems. 1) install vim) Open the command line to run sudoapt-getinstallvim, and enter the administrator password as prompted. Gcc + gdb) enter the command line to run sudoapt-getinstallbuild-essential build-essential, which contains tools such as gcc and gdb, and is a C Language Development Kit. Run
I. Overview
C and C ++ compilers are integrated. Compilation is generally divided into four steps:
Preprocessing)
Compile)
Assembly)
Connection (linking)
Gcc
The pre-processing file (. I) is a C file, and the C-form connection is set;
G ++
It is considered that the pre-processed file is (. I) A C ++ file, and a connection in the C ++ form is set;
Some Meanings of the source file suffix and subsequent operations:
. C source program preprocessi
From: http://hi.baidu.com/419836321/blog/item/690ba4a5bbc597ef9152ee26.html
Http://gcc.gnu.org/
To compile the software, the gcc4.4.1 version of Ubuntu is too high and gcc3.x is required. Therefore, you need to install GCC of the lower version. I chose gcc3.4.4.1. Download the Deb installation package. If I select the source code package for compilation and installation, an error will occur. Therefore, select Deb package for installation. The package
Recently developed with Xcode under Mac OS X Mountain Lion, there are two compilers shown below in the compilation options: One is Apple LLVM compiler 4.2 and the other is LLVM GCC 4.2.In recent years I've heard that LLVM is better than GCC, but I haven't had time to study the difference. Starting with this problem, I have thrown a lot of questions to myself:
CC, c89, what's C99? What's the differe
After studying linux gcc for a long time, I found that it is also necessary to understand linux gcc. Today I have collected the concepts and functions of Block devices for you. I hope you will have a lot to learn.
1. c/c ++ compiler included in linux gccGcc, cc, c ++, g ++:Gcc and cc are the same. c ++ and g ++ are the same. Generally, c Programs are compiled usi
Compile:
The first step is to pre-compile. The-E parameter allows GCC to stop the compilation process after preprocessing:
Gcc-E hello. c-o hello. I
Pre-processing macro definition inserted into hello. I
Step 2: Compile hello. I as the target code, which can be done by using the-c parameter:
Gcc-c hello. I-o hello. o
It can also be directly generated through the
I. mingw
Mingw official website for http://www.mingw.org/
Mingw, that is, minimalist GNU for Windows (GCC compiler suite ). It is a collection of header files and port libraries that allow people to use GCC (GNU Compiler C) to generate windows32 programs without a third-party dynamic link library.
Mingw: a Windows-specific header file that can be freely used and released, and a collection of imported and e
Best x GCC inline assemblyGuideAs you know, inserting the assembly language into the C language is the basic assembly program syntax used in Linux. This article describes the usage and usage of the inline assembly feature provided by GCC. There are only two prerequisites for reading this article. Obviously, it is the basic understanding of x86 assembly language and C language.1. Introduction1.1 copyright pe
Installing GCC:Yum install gccInstallation g++:yum install gcc-c++To install Python:The CentOS default is version 2.6,Download python, I downloaded the 2.7.10.1 Unpacking the installation packageTAR-ZXVF python-2.7. 10.tgz2 Compiling the installationThe CD switches to the python-2.7. 10 directory. /configure--prefix=/usr/local/python-2.7. Ten make install3 Creating a soft linkMv/usr/bin/python/usr/bin/p
GCC and G ++ is now the most important and popular C C ++ compiler in GNU. GCC/g ++ requires the following steps in total during compilation:1. pre-process and generate the. I file [pre-processor CPP]2. Do not convert the pre-processed files into assembly languages to generate the file. s [compiler egcs]3. a. o file is generated by means of compilation into the target code (machine code) [assembler as]4. C
You may often use gcc-static ***. C. What commands and libraries are used for this static link?
First, let's analyze what libc. A is. We already know that XXX. So is a dynamic link library, XXX. O is a static link library or relocated file, And/bin/bash is an executable file.
Libc. A is actually a collection of many relocated files, and generally only one function is written in each relocated file. For example, printf. O only has one printf function t
Source: Linux community Author: Fu Dapeng 2008
To program C in Linux, you must use GNU gcc to compile C source code to generate executable programs.
1. GCC Quick Start
The general format of GCC commands is: GCC [Option] file to be compiled [Option] [target file]
The target file can be the default. The executable file n
Static and dynamic libraries generated by GCC
I. Introduction to library files
To put it simply, a library is a set of functions and variables that have been written and compiled code. It is designed to improve development efficiency and running efficiency. Libraries are classified into static libraries and shared libraries. The extension of the static library file is. A, and the extension of the shared library file is. So (in the cygwin environment,
ArticleDirectory
4. Warning options
5. connection options
GCC compiler (1) 4. Warning options
During compilation, the compiler reports errors and warningsProgramThe GCC contains the complete error check and warning function, which can help Linux programmers identify the error or potential error as soon as possible.CodeTo write better code. The following table lists the
For software compilation, the gcc4.4.5 version of Ubuntu 10.10 LTS is too high and gcc3.x is required. Therefore, you need to install gcc of lower version. I chose gcc3.3.6.1. Download the deb installation package. If I select the source code package for compilation and installation, an error will occur. Therefore, select deb package for installation. The package I downloaded is:Cpp-3.3_3.3.6-15ubuntu6_i386.debGcc-3.3_3.3.6-15ubuntu6_i386.debGcc-3.3-b
It is particularly worth mentioning that there are many points worth learning about Linux gcc compilation. Here we mainly introduce Linux gcc compilation, including Linux gcc compilation. How can I use php to call a function compiled into the so file? One method is to write a php module (php extension), call the functions in this module in php, and then call the
Ubuntu uses gcc of different versionsDifferent Versions of ubuntu have different gcc, such as ubuntu 10.04 default gcc version is gcc-4.4.1, ubuntu 10.10gcc default version is gcc-4.4.5.However, in actual use, we want to use other gcc
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.