Installing the GCC compiler on Sun Solaris

Source: Internet
Author: User
Tags ftp

GCC is the GNU Free C compiler, which is installed by default for many Linux releases. Many popular free software original code can be compiled and run under the GCC compiler.

Although GCC has many platforms (operating system) versions, the General commercial UNIX system does not install GCC, in order to use GCC on these operating systems, you must install it yourself. The following is a description of the steps to get GCC, install, and debug on the Sun Solaris operating system.

1 Get GCC software that is consistent with the operating system and operating system version, and if you want to use GCC on the Solaris 2.5.1, get a matched gcc


2 Decompression

. GZ indicates that this is a file that has been compressed by gzip. Need to use Gzip/gunzip software first decompression.

$ gunzip gcc-

3 Installation

After the decompression is the installation package. Install a package of specialized commands and procedures in the Solaris operating system


In the next installation, there will be an interactive installation process.

4 Debugging

In the case of gcc-, GCC's default installation path is/opt/gcc2721, which may not be in the range represented by the user's path variable, so the path variable needs to be updated to make it easier to use GCC.

For users who use CSH:

% setenv path= $PATH:/opt/gcc2721/bin

For users using SH:

$ path= $PATH:/opt/gcc2721/bin

$ Export PATH

If you do not want to update the PATH environment variable every time you use GCC, you can write the above content in the user's initial file:

For CSH users: written in the. cshrc file in the user's home directory

To SH User: written in the. profile file in the user's home directory

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.