There is no C compiler included in Solaris 2.x. The /usr/ucb/cc script
you are executing is a wrapper for the SunSoft C compiler which
calls the native C compiler with the /usr/ucb includes and libraries.
You need to get yourself a C compiler. Alternatively,
you may have forgotten to put the proper link from /usr/ccs/bin/ucbcc
to /opt/SUNWspro/SCxxxx/cc in place. See also 6.1.
If you do have a real compiler somewhere else, either put it earlier in
your path [PATH=/opt/SUNWspro/bin:....:/usr/ucb]
or if it is named something other than "cc", make a link as appropriate.
[PATH=/usr/local/bin:...:/usr/ucb ; ln -s ./gcc /usr/local/bin/cc]
It's best to not have /usr/ucb in your PATH anyway.