如何安装使用免费c及c++编译器


    内容
    提要 如果客户不想购买IBM VAC & VACPP产品,我们提供另一种方法使用户可以编译自己的程序。
    第一步:下载
    第二步:安装
    第三步:配置

    正文 第一步:下。载
    http://www.bullfreeware.com/download/aix43/gnu.gcc-2.95.3.0.exe
    http://www.bullfreeware.com/down ... cc.g++-2.95.3.0.exe

    第二步:安装
    # ls
    gnu.gcc-2.95.3.0.exe
    gnu.gcc.g++-2.95.3.0.exe
    # chmod +x *exe
    # ./gnu.gcc-2.95.3.0.exe
    UnZipSFX 5.41 of 16 April 2000, by Info-ZIP (Zip-Bugs@lists.wku.edu).
    --inflating: gnu.gcc-2.95.3.0.bff
    --inflating: gnu.gcc-2.95.3.0.bff.asc
    # ./gnu.gcc.g++-2.95.3.0.exe
    UnZipSFX 5.41 of 16 April 2000, by Info-ZIP (Zip-Bugs@lists.wku.edu).
    --inflating: gnu.gcc.g++-2.95.3.0.bff
    --inflating: gnu.gcc.g++-2.95.3.0.bff.asc
    # inutoc .
    # installp -aXgd . all
    +-----------------------------------------------------------------+
    Pre-installation Verification...
    +-----------------------------------------------------------------+
    Verifying selections...done
    Verifying requisites...done
    Results...

    SUCCESSES
    ---------
    Filesets listed in this section passed pre-installation verification
    and will be installed.

    Selected Filesets
    -----------------
    freeware.gnu.gcc.g++ 2.95.3.0 ---# GNU Compiler Collection Extras
    freeware.gnu.gcc.rte 2.95.3.0 ---# GNU Compiler Collection

    << End of Success Section >>

    FILESET STATISTICS
    ------------------
    2 Selected to be installed, of which:
    --2 Passed pre-installation verification
    ----
    2 Total to be installed

    Filesystem size changed to 1179648
    +----------------------------------------------------------------+
    Installing Software...
    +----------------------------------------------------------------+
    installp: APPLYING software for:
    --------freeware.gnu.gcc.rte 2.95.3.0

    . . . . . << Copyright notice for freeware.gnu.gcc >> . . . . . . .

    GCC, GNU Compiler Collection, version 2.95.3
    Copyright (C) 2001 Free Software Foundation, Inc.

    Plaese refer to the COPYING file delivered in the directory
    /usr/local/lib/gcc-2.95.3 for complete details. The README file delivered
    in the same directory should also be read.

    Packaging is Copyright (C) 2001 BULL SA.

    This LPP shall not be redistributed commercially. Software, information
    and material distributed as freeware or shareware (hereinafter the
    "Materials") are provided "as is", without warranty of any kind.

    Bull and its suppliers disclaim all warranties whether expressed or
    implied, including, but not limited to the implied warranties of
    merchantability and fitness for a particular purpose. The entire risk
    as to the quality and performance of the Materials is with you.
    Neither Bull nor its suppliers warrant that the functions contained
    in the Materials will meet your requirements or that the Materials
    will be error free.

    Bull and its suppliers shall in no event be liable for direct or indirect
    damage caused to the User or to third parties by use of the Materials,
    whether in an action of contract, negligence or other tortious action,
    arising out of or in connection with the use or performance of the
    Materials.
    . . . . . << End of copyright notice for freeware.gnu.gcc >>. . . .

    Post-inststallation configuration - generate fixed header files
    This will take several minutes
    To re-execute this procedure (after installing new include files)
    perform the fillowing commands
    ----# cd /usr/local/lib/gcc-2.95.3
    ----# ./dofix
    lsdev: 0514-518 Cannot access the CuDv object class in the device
    --------configuration database.
    /usr/sbin/lsattr: option requires an argument -- l
    lsattr: 0514-500 Usage error - _=/usr/sbin/lsattr

    Usage:
    lsattr {-D[-O]| -E[-O] | -F Format} -l Name [-a Attribute]...[-H]
    [-f File]
    lsattr {-D[-O]| -F Format}{[-c Class][-s Subclass][-t Type]}[-a Attribute]...
    [-H][-f File]
    lsattr -R {-l Name | [-c Class][-s Subclass][-t Type]} -a Attribute [-H]
    [-f File]
    lsattr -h

    Fixing headers into /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includt
    Finding directories and links to directories
    Searching /usr/include/.
    Searching /usr/include/./X11
    Searching /usr/include/./uil
    Searching /usr/include/./Xm
    Searching /usr/include/./Mrm
    All directories (including links to directories):
    ./sys ./diag ./nfs ./rpcsvc ./nsl ./tirpc ./tirpc/rpc ./tirpc/rpcsvc
    ./oncplus s
    Making symbolic directory links
    ./X11 -> root/usr/lpp/X11/include/X11 : Making rooted link
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includs
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includm
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includa
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includm
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includw
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includu
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includt
    Duplicating ./X11's /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/includs
    ./uil -> Motif1.2/uil : Making local link
    ./Xm -> Motif1.2/Xm : Making local link
    ./Mrm -> Motif1.2/Mrm : Making local link
    Fixing directory /usr/include into /usr/local/lib/gcc-lib/powerpc-ibm-
    aix4.3.2.e
    Applying Io_Def_Quotes ----------to ./sys/ioctl.h
    Applying Isc_Sys_Limits ---------to ./sys/limits.h
    Applying Hpux_Maxint ------------to ./sys/param.h
    Applying Aix_Volatile -----------to ./sys/signal.h
    Fixed: ./sys/signal.h
    Applying Io_Def_Quotes ----------to ./sys/stropts.h
    Applying Ioctl_Fix_Ctrl ---------to ./sys/ttychars.h
    Fixed: ./sys/ttychars.h
    Applying Irix_Multiline_Cmnt ----to ./sys/types.h
    Applying Systypes ---------------to ./sys/types.h
    Applying Systypes_For_Aix -------to ./sys/types.h
    Fixed: ./sys/types.h
    Applying Next_Wait_Union --------to ./sys/wait.h
    Fixed: ./sys/wait.h
    Applying No_Double_Slash --------to ./nsl/cache.h
    Fixed: ./nsl/cache.h
    Applying Io_Def_Quotes ----------to ./net/bpf.h
    Applying Machine_Name -----------to ./net/bpf.h
    Fixed: ./net/bpf.h
    Applying End_Else_Label ---------to ./net/bpfdesc.h
    Fixed: ./net/bpfdesc.h
    Applying Io_Def_Quotes ----------to ./netinet/if_802_5.h
    Fixed: ./netinet/if_802_5.h
    Applying Ip_Missing_Semi --------to ./netinet/ip.h
    Applying Machine_Name -----------to ./Motif1.2/Xm/XmosP.h
    Fixed: ./Motif1.2/Xm/XmosP.h
    Applying Machine_Name -----------to ./arpa/nameser_compat.h
    Fixed: ./arpa/nameser_compat.h
    Applying Machine_Name -----------to ./arpa/onameser_compat.h
    Fixed: ./arpa/onameser_compat.h
    Applying Irix_Sockaddr ----------to ./rpc/auth.h
    Applying Sun_Auth_Proto ---------to ./rpc/auth.h
    Fixed: ./rpc/auth.h
    Applying Sun_Auth_Proto ---------to ./rpc/clnt.h
    Fixed: ./rpc/clnt.h
    Applying Nested_Comment ---------to ./rpc/rpc.h
    Applying Sun_Auth_Proto ---------to ./rpc/svc.h
    Applying Ultrix_Nested_Cmnt -----to ./rpc/svc.h
    Fixed: ./rpc/svc.h
    Applying Cxx_Unready ------------to ./rpc/types.h
    Fixed: ./rpc/types.h
    Applying Irix_Struct__File ------to ./rpc/xdr.h
    Applying Sun_Auth_Proto ---------to ./rpc/xdr.h
    Fixed: ./rpc/xdr.h
    Applying Avoid_Bool -------------to ./curses.h
    Applying Void_Null --------------to ./curses.h
    Fixed: ./curses.h
    Applying Bad_Lval ---------------to ./dirent.h
    Applying Bad_Lval ---------------to ./ftw.h
    Applying Bad_Lval ---------------to ./grp.h
    Applying End_Else_Label ---------to ./netiso/argo_debug.h
    Fixed: ./netiso/argo_debug.h
    Applying Machine_Name -----------to ./netiso/clnp.h
    Fixed: ./netiso/clnp.h
    Applying End_Else_Label ---------to ./netiso/cons_pcb.h
    Fixed: ./netiso/cons_pcb.h
    Applying Machine_Name -----------to ./netiso/esis.h
    Fixed: ./netiso/esis.h
    Applying End_Else_Label ---------to ./netiso/tp_param.h
    Fixed: ./netiso/tp_param.h
    Quoted includes in ./netiso/tp_param.h
    Applying Machine_Name -----------to ./netiso/tp_tpdu.h
    Fixed: ./netiso/tp_tpdu.h
    Applying End_Else_Label ---------to ./netiso/tp_trace.h
    Fixed: ./netiso/tp_trace.h
    Quoted includes in ./netiso/tp_trace.h
    Applying End_Else_Label ---------to ./netiso/tp_user.h
    Fixed: ./netiso/tp_user.h
    Quoted includes in ./netiso/tp_user.h
    Applying Bad_Lval ---------------to ./libgen.h
    Applying Limits_Ifndefs ---------to ./limits.h
    Applying Void_Null --------------to ./locale.h
    Fixed: ./locale.h
    Applying Sun_Malloc -------------to ./malloc.h
    Applying Math_Exception ---------to ./math.h
    Applying Math_Gcc_Ifndefs -------to ./math.h
    Applying Rs6000_Double ----------to ./math.h
    Applying Sunos_Matherr_Decl------to ./math.h
    Applying Ultrix_Atof_Param ------to ./math.h
    Fixed: ./math.h
    Applying Bad_Lval ---------------to ./ndbm.h
    Applying Machine_Name -----------to ./netns/ns.h
    Fixed: ./netns/ns.h
    Applying Machine_Name -----------to ./netns/spp_var.h
    Fixed: ./netns/spp_var.h
    Applying Bad_Lval ---------------to ./pthread.h
    Applying Bad_Lval ---------------to ./pwd.h
    Applying Bad_Lval ---------------to ./signal.h
    Applying Bad_Lval ---------------to ./standards.h
    Applying Systypes ---------------to ./stddef.h
    Fixed: ./stddef.h
    Applying Io_Def_Quotes ----------to ./stdio.h
    Applying Rs6000_Param -----------to ./stdio.h
    Applying Stdio_Va_List ----------to ./stdio.h
    Applying Ultrix_Const -----------to ./stdio.h
    Fixed: ./stdio.h
    Applying Bad_Lval ---------------to ./stdlib.h
    Applying Systypes ---------------to ./stdlib.h
    Applying Sysz_Stdlib_For_Sun ----to ./stdlib.h
    Fixed: ./stdlib.h
    Applying Bad_Lval ---------------to ./string.h
    Applying Sysv68_String ----------to ./string.h
    Fixed: ./string.h
    Applying Sunos_Strlen -----------to ./strings.h
    Applying Bad_Lval ---------------to ./stropts.h
    Applying Avoid_Bool -------------to ./term.h
    Applying Bad_Lval ---------------to ./time.h
    Applying Bad_Lval ---------------to ./unistd.h
    Applying Rs6000_Param -----------to ./unistd.h
    Applying Machine_Name -----------to ./isode/general.h
    Fixed: ./isode/general.h
    Applying Machine_Name -----------to ./isode/manifest.h
    Fixed: ./isode/manifest.h
    Fixing directory /usr/include/X11 into /usr/local/lib/gcc-lib/powerpc-ibm-aix4.1
    Applying Machine_Name -----------to ./X11/ext/servermd.h
    Fixed: ./X11/ext/servermd.h
    Applying Machine_Name -----------to ./X11/Xfuncs.h
    Fixed: ./X11/Xfuncs.h
    Applying End_Else_Label ---------to ./X11/Xi18nlib.h
    Fixed: ./X11/Xi18nlib.h
    Applying Machine_Name -----------to ./X11/Xosdefs.h
    Fixed: ./X11/Xosdefs.h
    Copied ./netiso/tp_states.h
    Copied ./netiso/tp_events.h
    Copied ./netiso/../netiso/tp_pcb.h
    Cleaning up DONE files.
    Removing unneeded directories:
    Various warnings and error messages from fixproto are normal
    fixproto: populating `/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/incl'
    /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/syslimits.h:7: ware
    fix-header: In file included from /usr/include/nsl/thread.h:65,
    ------from /usr/include/nsl/rpc_mt.h:75,
    ------from /usr/include/nsl/nis_local.h:121,
    ------from /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/incl:
    /usr/include/pthread.h:113: warning: missing white space after `#define PTHREAD'
    /usr/include/pthread.h:128: warning: missing white space after `#define PTHREAD'
    /usr/include/pthread.h:147: warning: missing white space after `#define PTHREAD'
    /usr/include/pthread.h:157: warning: missing white space after `#define PTHREAD'
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/M)
    fix-header: fixing isode/general.h
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/r)
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/r)
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/r)
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/r)
    (No *.h files in /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95.3/include/r)
    fix-header: fixing root/usr/lpp/X11/include/X11/Xfuncs.h
    To re-execute this procedure (after installing new include files)
    perform the fillowing commands
    ----# cd /usr/local/lib/gcc-2.95.3
    ----# ./dofix
    No info directory found !
    stopping
    Filesets processed: 1 of 2 (Total time: 14 mins 35 secs).

    installp: APPLYING software for:
    --------freeware.gnu.gcc.g++ 2.95.3.0

    . . . . . << Copyright notice for freeware.gnu.gcc.g++ >> . . . . . . .
    GCC, GNU Compiler Collection, version 2.95.2
    Copyright (C) 1999 Free Software Foundation, Inc.

    Plaese refer to the COPYING file delivered in the directory
    /usr/local/lib/gcc-2.95.2 for complete details. The README file delivered
    in the same directory should also be read.

    Packaging is Copyright (C) 1999 BULL SA. This LPP may not be redistributed comercially. No warranty or support in any form is offered with this LPP. Groupe Bull will not be liable for errors contained herein, or for incidental or consequential damages in connection with the use of this material.

    . . . . . << End of copyright notice for freeware.gnu.gcc.g++ >>. . . .

    Finished processing all filesets. (Total time: 14 mins 55 secs).
    +-------------------------------------------------------------+
    Summaries:
    +-------------------------------------------------------------+
    Installation Summary
    --------------------
    Name ------------------Level------ Part--- Event----Result
    ---------------------------------------------------------------
    freeware.gnu.gcc.rte --2.95.3.0 -- USR ----APPLY ---SUCCESS
    freeware.gnu.gcc.g++ --2.95.3.0 -- USR ----APPLY ---SUCCESS

    第三步:配置
    主要是环境变量问题,编辑用户的profile文件,包含下列设置
    Export PATH=$PATH:/usr/local/bin
    Export LIBPATH=$LIBPATH;/usr/local/lib
    Export MANPATH=$MANPATH:/usr/local/man
    -------------------------相关参考------------------------------------------------------

    http://bbs.chinaunix.net/thread-831037-1-1.html

    http://www.unix.com/unix-dummies-questions-answers/28790-error-running-cobol-loader-does-not-exist.html

    http://gcc.gnu.org/ml/gcc-help/2006-12/msg00224.html

    http://www-03.ibm.com/systems/p/os/aix/linux/toolbox/download.html

    http://www.ibm.com/developerworks/forums/message.jspa?messageID=13925965

    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=138005

    http://archives.free.net.ph/message/20080125.221033.ff8c994c.pl.html

    http://archives.devshed.com/forums/development-94/linking-problems-with-gcc-4-2-2-and-aix-5t-2398022.html

    http://www.mydatabasesupport.com/forums/aix/363733-collect2-ld-returned-8-exit-status.html

    http://www-128.ibm.com/developerworks/forums/thread.jspa?threadID=140664

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

    仅供参考:
    据说是 libstdc++动态链接库路径问题
    尝试把该库加到搜索路径环境变量中LD_LIBRARY_PATH

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

    try using the GNU linker included with the binutils package.

    download and install the
    package.

    then

    Code:export PATH=/opt/freeware/bin:$PATHcpp

    does this work?

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

    2008年02月18日 星期一 23:58

     

    经常遇见朋友在aix安装gcc不成功的情况,简单写了个步骤:
    (1)下载安装所需文件
    gcc-4.0.0-1.aix5.3.ppc.rpm,
    gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm,
    libgcc-4.0.0-1.aix5.3.ppc.rpm,
    libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm,
    libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm
    地址为http://www-03.ibm.com/servers/aix/products/aixos/linux/download.html
    (2)因AIX5.3已默认安装rpm,故只需以root身份利用ftp将上述五个rpm文件上传到/usr/opt/freeware/src/packages/SOURCES(该目录aix中已有,并不象管理手册上所讲的--“要使用linux toolbox需要建立新的文件系统/opt/freeware”)
    (3)以root身份在/usr/opt/freeware/src/packages/SOURCES执行命令
    #rpm -ivh gcc-4.0.0-1.aix5.3.ppc.rpm
    #rpm -ivh libgcc-4.0.0-1.aix5.3.ppc.rpm
    #rpm -ivh libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm
    #rpm -ivh libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm
    #rpm -ivh gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm
    最多不超过一分钟gcc、gcc++安装完成,以普通用户登录,编一个“hello world”测试程序结果正确!
    呵呵!这样就不需要象以前的文档所说的那样那么麻烦的安装配置gcc(gcc++)-x.x.x-x.exe了!希望能够对有在aix上使用gcc(gcc++)的朋友有所帮助!

     

     

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

    所有版本gcc下载地址