Installing GCC on Oracle Solaris 11

后端 未结 9 2079
北荒
北荒 2020-12-05 11:26

i recently got Oracle Solaris on my VM to test some code on it, i was unable to install gcc since i dont really know how, i googled alot but all info is about oracle compile

相关标签:
9条回答
  • 2020-12-05 11:31

    The original answer applied to Solaris 11 Express/non-official release - if you're doing this today with a full release of Solaris 11.x, use the pkg install command like you see in xavier's response.

    Run this command from your terminal to install GCC.

    For GCC 3.4.x

    pkg install gcc-3
    

    For GCC 4.5.x

    pkg install gcc-45
    

    For GCC 4.7.x

    pkg install gcc-47
    

    For GCC 4.8.x

    pkg install gcc-48
    

    The gcc command should then already be placed in your path /usr/bin/gcc, which is a symlink).


    Old Answer Solaris 11 should already have gcc installed in /usr/sfw/bin/, but it's probably not in your PATH. Try this at the prompt: /usr/sfw/bin/gcc

    0 讨论(0)
  • 2020-12-05 11:32

    Two steps:

    1. pkg install gcc-45
    2. pkg install system/header

    that is all

    if you see more info http://blog.csdn.net/zjg555543/article/details/8217769

    0 讨论(0)
  • 2020-12-05 11:37

    Solaris 10 and prior version :

    /usr/sfw/bin/gcc works.

    Solaris 11 :

    pkg install gcc-3

    0 讨论(0)
  • 2020-12-05 11:40
    pkg install gcc 
    

    worked for me

    This will install entire gcc collection on your machine. Which anyways will be required

    0 讨论(0)
  • 2020-12-05 11:42

    I had the same problem and 'pkg install gcc-3' worked for me.

    0 讨论(0)
  • 2020-12-05 11:43

    I'll quote the answer from unix.stackexchange.com.

    On Solaris 11 gcc is not installed by default. Normally you'll want more than just the compiler itself so my answer will include all the usual suspects for building open source software on Solaris that you've downloaded from somewhere in source code format.

    By far the easiest is to use IPS to install it using the commands below (while being root or other superuser):

    pkg install pkg://solaris/developer/build/gnu-make \
                pkg://solaris/developer/build/make \
                pkg://solaris/developer/gcc \
                pkg://solaris/system/header \
                pkg://solaris/developer/build/autoconf \
                pkg://solaris/developer/build/automake
    

    (I use fully qualified package names here, that is not really necessary)

    Note that some of the packages are available in the official repo in various versions. If you just reference developer/gcc then you'll at the time of writing this get GNU C v4.8.2, but you may explicitly ask for a prior version, e.g. by using package name such as developer/gcc-45.

    0 讨论(0)
提交回复
热议问题