您的位置:首页 > 运维架构

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

2015-05-11 10:46 363 查看
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?

1
down vote
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.

shareimprove
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

[code]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 ...)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐