Installing GCC on Oracle Solaris 11

Just download gcc from its homepage, follow one of the mirror links to fetch the latest binary package (in .tar.gz or tar.bz2 format), and use traditional steps to build:

  1. ./configure --<> // give your options
  2. make
  3. make install

The good news is you can customize what you need and always stay with the latest, while bad part is you may lose the power to debug with mdb/adb - we are facing such problems with latest GCC 4.6.x


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


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