Operating System - HP-UX
1833669 Members
3771 Online
110062 Solutions
New Discussion

inability to compile programs, don't know what's wrong

 
SOLVED
Go to solution
Mark Vollmers
Esteemed Contributor

inability to compile programs, don't know what's wrong

Hi, all. I don't know if I've got something setup wrong here, or just stupid. I've never been able to compile programs and run them. Thankfully, I've been able to get .depots for stuff, but I'm on my own for this program. Here's what I've got.

Evidently, I have CC on the workstation (10.20). I installed GCC. In this instance, I downloaded and untarred the glib 1.2.10 program. following the INSTALL file, I run the #./configure command (as root). attached is the output. then I go and run the #make install (I will attach here in a moment). it errors out on me here. I have never (and I mean that) gotten a make command to compile a program. I'm not sure what I'm doing. from the output, it looks like it's calling CC, not GCC. I'd say that the error would be an extranous character that is throwing off the lines (like a semi-colon dropping to the next line and is all by itself), but the file should be creating itself, so why would it have issues. I quickly glanced at it, and nothing jumped at me. I can attach other files if needed (like glib.h). any ideas as to what's going on here? Thanks!

Mark

"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
10 REPLIES 10
Mark Vollmers
Esteemed Contributor

Re: inability to compile programs, don't know what's wrong

sorry about that. first output
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Mark Vollmers
Esteemed Contributor

Re: inability to compile programs, don't know what's wrong

second output
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: inability to compile programs, don't know what's wrong

Hi Mark:

You are definitely using the bundled C compiler rather than gcc. If I were you, I would remove gcc and start over. I suspect that you are missing the 'binutils' which are an essential part of gcc. You also need to make sure that gcc, gmake, gas, ... are in your PATH.

If it ain't broke, I can fix that.
Hartmut Lang
Trusted Contributor

Re: inability to compile programs, don't know what's wrong

Yes you are using cc not gcc!
As Clay said make sure gcc is in your PATH. And i would suggest, before calling the configure command, set the CC environment to gcc:
export CC=gcc
./configure
make

Hartmut
Mark Vollmers
Esteemed Contributor

Re: inability to compile programs, don't know what's wrong

Alright. I'll go ahead and re-install, etc. Got a few questions, though. What's the difference between the two? is cc really that bad of a program that it won't compile common stuff that you can download? if so, why is it included (I mean, gcc is free)?

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Pete Randall
Outstanding Contributor

Re: inability to compile programs, don't know what's wrong

Mark,

I believe cc is just a stripped down compiler that HP ships just to build the kernel.

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: inability to compile programs, don't know what's wrong

The bundled cc is not bad, but it is limited. The biggest limitation is that it speaks only K & R C. Nobody codes in K & R anymore (or at least they shouldn't). The bundled compiler is included for one primary reason - to build new kernels. If you happen to use it to compile other source code, that's just gravy. You will also find that you are missing quite a few other essential tools as well (e.g. yacc).

I'm really not that big a fan of gcc either; it's main virtue is that it is free. I actually prefer to purchase the HP versions so that if there is a bug, I have someone to yell at and they are paid to listen.
If it ain't broke, I can fix that.
Mark Vollmers
Esteemed Contributor

Re: inability to compile programs, don't know what's wrong

ALright. I'm in the middle of installing. I have GNUmake installed, and binutils. I have compiled the code for gcc, but get an error in building it. one thing I wanted to do was to make sure that it was looking for gnumake when I use the make command. I look at PATH, and there's a bunch of stuff in there (some several times). Now, this may sound dumb, to add something, do I just assign it and it will append this to the list? (PATH=xxx/yyy) what if I wanted to clear out old stuff in there?

Thanks.

mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Hartmut Lang
Trusted Contributor

Re: inability to compile programs, don't know what's wrong

your PATH problem:

Add the path of the GNUmake in front of your existing PATH:
PATH=/path_to_gmake:$PATH

OR
Cleanup eveyrthing, but make sure you do not miss important pathes:
PATH=/path_to_gmake:/path1_youneed:/path2_you_need:...

Check your .profile, probably you duplicate parts of PATH in there. Also check /etc/PATH (default values for all users) for duplicate entries. Only change /etc/PATH, if you know what you are doing.

Hartmut
Pete Randall
Outstanding Contributor

Re: inability to compile programs, don't know what's wrong

Or, to cleanout your path and reset it to original values (assuming you use /etc/PATH):
export PATH=`cat /etc/PATH`:/path_to_gnu_make

Good luck,
Pete

Pete