/usr/ucb/cc: language optional software package not installed

0 down vote favoriteI tried to compile some C code to get object file from a shell prompt:$cc a.c But this gives me the following error:/usr/ucb/cc: language optional software package not installedHow can I compile C code?


It is unfortunate that sun ever shipped /usr/ucb/cc; you would thinkit was compatible with SunOS 4; instead it compatible with some veryold version of 4.2 but it also required the installation of theSunPro (Now Solaris Studio) compilers.

These compilers can be downloaded from

http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html

under the following license terms (quoted from the above page)

Provides perpetual no-cost license for production use and the development of commercial applications.

share improve this answer



First, you should probably remove /usr/ucb from your PATH as this directory is quite obsolete now. It was meant to ease people migrating from SunOS 4 to Solaris 2 a couple of decades ago but doesn't make much sense these days. Especially this cc commands which set specific flags to compile BSDish code.

Second, all current Solaris releases comes with a C compiler out of the box but it is located in a directory which might not be in your PATH, /usr/sfw/bin and is named gcc (Gnu compiler).

use /usr/sfw/bin/gcc

or

PATH=$PATH:/usr/sfw/bin
gcc

Alternatively, you might have already installed (or you can install) the Solaris Studio compiler. In that case, its path would be <installation-dir>/bin/cc (eg: /opt/SUNWspro/bin/cc or /opt/SolarisStudio11/bin/cc etc ...)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值