Operating System - HP-UX
1834142 Members
2256 Online
110064 Solutions
New Discussion

Re: /usr/bin/g++: execution denied

 
sunil_7
Occasional Advisor

/usr/bin/g++: execution denied

We downloaded a tar file for gcc and just untar it on hp machine. It did not ask for any installation procedure. It was working fine till yesterday. But, after that whenever I run any of the command in gcc, it gives the following error:

sh: /usr/bin/g++: execution denied

Although all other commands, which are native ones, are working fine.
I checked up, by working with root password and also, by giving 777 permission to the folder itself recursively.

But the problem is persisting.

8 REPLIES 8
Santosh Nair_1
Honored Contributor

Re: /usr/bin/g++: execution denied

If it was working fine and now it doesn work, then I would suspect that the file has somehow become corrupt. What do you get if you do a file on the executable, i.e.:

file /usr/bin/g++

you should get something like:

PA-RISC1.1 shared executable dynamically linked

-Santosh
Life is what's happening while you're busy making other plans
sunil_7
Occasional Advisor

Re: /usr/bin/g++: execution denied

I get the following output
# file gcc
gcc: awk program text

But this is not the only commands what all commands are there in gcc folder are giving error. but the core commands are not giving any error.

do u have any idea of any site, from where we can download compiled gcc compiler for hp. From the gnu site, we have to compile and then use.
Santosh Nair_1
Honored Contributor

Re: /usr/bin/g++: execution denied

Sounds like all your executables are bad. You can dowload gcc from HP's devresource page:

http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,547,00.html

-Santosh
Life is what's happening while you're busy making other plans
Santosh Nair_1
Honored Contributor

Re: /usr/bin/g++: execution denied

Forgot to mention that the devresource site has binaries for 11.0 and 11i. If you need the gcc for 10.20 you can get it from the HP porting center. Remember to grab binutils also as this is a requirement for the compiler:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.0.1/

-Santosh
Life is what's happening while you're busy making other plans
linuxfan
Honored Contributor

Re: /usr/bin/g++: execution denied

Hi Sunil,

Since gcc was working fine for sometime, is it possible someone overwrote the binary?

If you still have the tar file you downloaded, try untarring it first and see if that fixes it, if not you may have to download it again.

-Ramesh
They think they know but don't. At least I know I don't know - Socrates
A. Clay Stephenson
Acclaimed Contributor

Re: /usr/bin/g++: execution denied

Hi Sunil:

The other thing that may have happened is that a bad makefile or script may be clobbering /usr/bin/g++ rather that writing to the correct file.

If it ain't broke, I can fix that.
sunil_7
Occasional Advisor

Re: /usr/bin/g++: execution denied

Thanx santash

I could download it and it is working fine.
sunil_7
Occasional Advisor

Re: /usr/bin/g++: execution denied


http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.0.1/

As Mr. Suntosh asked, I have downloaded gcc from the above mentioned site. I want to know, as by default on hpux11.0 it is aCC header files and libraries, which are set. When we compile the code with g++ will it automatically include the header files of gcc and while linking take libraries of gcc, rather than aCC. I am not including any path for header files of gcc as it gives the errors.