bash$ cc test.c
/usr/ucb/cc: language optional software package not installed
bash$ g++ test.c
cc1plus: /usr/local/include: Permission denied
bash$ cat test.c
#include <stdio.h>
int main () {
printf("Test\n");
return 0;
}
bash$ echo $PATH
/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/opt/sfw/bin
I'm using Solaris 10 update 6. All these are coming when I apply these
commands as regular user. Everything's ok with root user.
To check if the user account has problems I created a new user account
and then tried these commands. It happens all the same. I didn't have
these problems with Solaris 10 update 5.
Tell me how can I fix it.
|----------------------------------------------------------------------|
|----------------------------------------------------------------------|
As root, try the two commands
chmod -R a+r /usr/local/include
chmod -R a+x /usr/local/include
and if #include still does not work, then
cd /usr
chmod a+r local
chmod a+x local
chmod a+r local/include
chmod a+x local/include
and if it still has not been solved yet, then
cd /
chmod a+r usr
chmod a+x usr
chmod a+r usr/local
chmod a+x usr/local
.
Perhaps somewhat excessive, but perhaps successful.
Good luck,
Colin Paul Gloster
Why are you trying to use a C++ compiler to compile a C file? And is
your 'c++' really /usr/sfw/bin/c++, or some other 'c++'? If the former,
I don't know why it's trying to look in /usr/local. I have no /usr/local
on any of my Solaris machines.
> bash$ cc test.c
> /usr/ucb/cc: language optional software package not installed
You have heard of google, haven't you?
For info, cc and CC are Sun's C and C++ compilers. gcc and g++/c++ are
GNU's C and C++ compilers.
> bash$ cat test.c
> #include <stdio.h>
>
> int main () {
A C main should either take argc/argv arguments or void.
> printf("Test\n");
> return 0;
> }
>
> bash$ echo $PATH
> /usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin:/opt/sfw/bin
Unless you are working with old old BSD code, put /usr/ucb at the end of
your PATH (or remove it entirely). Put /usr/ccs/bin in your path. And if
you want to be really standard (XPG/SUS), put
/usr/xpg6/bin:/usr/xpg4/bin in your PATH.
A Bientot
Paul
--
Paul Floyd http://paulf.free.fr