Get the App
SLTechnology News&Howtos  ›  Servers  › 

Install c, C++ compiler on AIX

Shulou Source: shulou.com Published: 2022-06-02 05:47:01 11月15日 Update

To install the xlc compiler, please refer to https://www.ibm.com/developerworks/cn/aix/library/au-c_installation/index.html.

The default installation path is: / opt/IBM/xlC/13.1.0/

# ln-sf / opt/IBM/xlc/13.1.0/bin/xlc / usr/bin/cc-- > execute the command

# export PATH=/opt/IBM/xlc/13.1.0/bin/:$PATH-- > modify / etc/profile

Download the rpm package at ftp://www.oss4aix.org/compatible/aix71/

Installation

Rpm-Uvh gcc-4.9.4-1.aix7.1.ppc.rpm gcc-cpp-4.9.4-1.aix7.1.ppc.rpm gmp-6.1.2-1.aix5.1.ppc.rpm info-6.5-1.aix5.1.ppc.rpm libgcc-4.9.4-1.aix7.1.ppc.rpm libgomp-4.9.4-1.aix7.1.ppc.rpm libiconv-1.15-1.aix5.1.ppc.rpm Libmpc-1.1.0-1.aix5.1.ppc.rpm libstdc++-4.9.4-1.aix7.1.ppc.rpm mpfr-3.1.6-1.aix5.1.ppc.rpm zlib-1.2.4-2.aix5.1.ppc.rpm gettext-0.10.40-8.aix5.2.ppc.rpm

Rpm-Uvh gcc-c++-4.9.4-1.aix7.1.ppc.rpm libstdc++-devel-4.9.4-1.aix7.1.ppc.rpm

Some tables are relatively new in https://www.ibm.com/developerworks/aix/library/aix-toolbox/date.html

Update the package

Rpm-Uvh gcc-6.3.0-2.aix7.1.ppc.rpm gcc-cpp-6.3.0-2.aix7.1.ppc.rpm libgcc-6.3.0-2.aix7.1.ppc.rpm libgomp-6.3.0-2.aix7.1.ppc.rpm libstdcplusplus-6.3.0-2.aix7.1.ppc.rpm zlib-1.2.11-1.aix6.1.ppc.rpm gettext-0.19.8.1-1.aix6 .1.ppc.rpm gcc-cplusplus-6.3.0-2.aix7.1.ppc.rpm libstdcplusplus-devel-6.3.0-2.aix7.1.ppc.rpm ncurses-6.1-1.aix6.1.ppc.rpm intltool-0.51.0-2.aix6.1.noarch.rpm set the environment variable

# export PATH=$PATH:/opt/freeware/bin

Get a C program to test.

# cat helloworld.c

/ * Hello World C Program * /

# include

Main ()

{

Printf ("Hello World!")

}

# gcc helloworld.c-o helloworld

# ls

#. / helloworld

Hello World!

Try a C++ program.

# cat helloworld.cc

# include

Using namespace std

Int main ()

{

Cout

Tags: Compile Program Test Compiler variable Command Environment path clocked reference Update run C++ Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL vpn Apple Shulou Technology