Solaris installation GCC

Source: Internet
Author: User
Tags gz file

1 View Sun OS version
uname-a command to view the system version. learned that it was SunOS 5.8.
SunOS 5.8 is called Solaris 8
SunOS 5.9 is called Solaris 9, and there is no 5.x in the future, to Solaris 10 ...

2 Installing GCC
1. Download gcc-3.4.6-sol8-sparc-local.gz to Www.sunfreeware.com
2. Gunzip gcc-3.4.6-sol8-sparc-local.gz
3. Pkgadd–d Gunzip gcc-3.4.6-sol8-sparc-local
4. Manually set the root environment variable, add path, Ld_library_pat
Export path= $PATH:/usr/local/bin
Export ld_library_path=$ Ld_library_path:/usr/local/lib
After the discovery gcc-v error: Ld.so.1:gcc:fatal:libintl.so.3:open failed:no such file or directory, then to install Libintl Library

3 Installing LIBINTL Library
1. Download from www.sunfreeware.com libintl-3.4.0-sol8-sparc-local.gz
2. Gunzip libintl-3.4.0-sol8-sparc-local.gz
3. Pkgadd–d libintl-3.4.0-sol8-sparc-local.gz
After the discovery gcc-v error: Ld.so.1:gcc:fatal:libiconv.so.2:open failed:no such file or directory, then to install Libiconv Library

4 Installing Libiconv Library
1. Download from http://www.sunfreeware.com libiconv-1.11-sol8-sparc-local.gz
2. Gunzip libiconv-1.11-sol8-sparc-local.gz
3. Pkgadd–d libiconv-1.11-sol8-sparc-local.gz
After installation Gcc-v finally no longer error
5. Install LIBGCC Library

--------------------------------------------------------------------------------------------------------------- ----

GCC is a GNU-free C translator, which is installed by default in many Linux distributions. A lot of popular
's free software original code can be translated and run in the GCC translator.
Although GCC has a number of platform (operating system) versions, the General commercial UNIX system is not installed in GCC, to
Using GCC on these operational systems, you have to install them yourself.
The following is a major introduction to GCC, installation and test steps in the Sun Solaris operating system.

1 The GCC software that is aligned to the operating system and operating system version is obtained
If you want to use GCC on the Solaris 2.5.1, get a matched gcc
Ftp://ftp.cdit.edu.cn/pub/unix/solaris/sparc25/gcc-2.7.2.1.gz

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-2.7.2.1.gz

3 Installation
The solution is an installation package. A set of specialized commands and procedures are installed in the Solaris Operations system
#pkgadd-D./gcc-2.7.2.1
In the next installation, there is an interactive installation process.

4 Tuning
In the case of gcc-2.7.2.1, the default installation path for GCC is/opt/gcc2721, and this path may not be
Of the user's path change, so you need to update the path change to make it easier to use GCC.

For users who use CSH:
% setenv path= $PATH:/opt/gcc2721/bin
For use of SH User:
$ path= $PATH:/opt/gcc2721/bin
$ Export PATH

If you do not want to update the PATH environment change every time you use GCC, you can write the above content in the user initial file
In
For CSH User: written in the. cshrc file under the user's main account
For SH User: written in the. profile file under the user's main account

5 common problems
Q: When compressing the gcc-version.gz file, the prompt "Gunzip not found"
A: It could be you're okay. First install the Gzip/gunzip software, download the gzip for phase OS first, but
installed.
It could be gzip/gunzip. Not in the path search path, view/usr/local/bin, if any,
Use Gunzip plus the absolute path.

Q: The successful installation of GCC, in the translation software is wrong "can ' t find gcc."
A: The biggest possibility is that GCC's record is not in the user's search path path. In accordance with this
The 4th step is to do the methods described in the article.

Q: How to install using C + + translator [ADDED:1999/10/24]
A:GCC provides g++ as a substitution for C + + and generally uses g++ 's library to download the needle against your OS
Version of the libstdc++ package, however installed.
Install the LD_LIBRARY_PATH environment change to allow the libstdc++ library to be used by other programs.
$LD _library_path=/usr/local/lib
$export Ld_library_path

6 Related Resources
Ftp://ftp.cdit.edu.cn/pub/unix/solaris/provides the gcc,gzip described in this article
http://www.gnu.org GNU Organization web site
The http://metalab.unc.edu/North Carolina University website provides solaris2.x,7 for GCC under
The installation package of the GNU software
At the same time there are a lot of original code and Linux under the software

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: info-contact@alibabacloud.com 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.