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
pkg install gcc
worked for me
This will install entire gcc collection on your machine. Which anyways will be required