Activating the CC (C compiler) on my UNIX terminal

Belaran

Registered
Hi !

I'm student and i'm going to use C next year and i would like to use "CC C_source.c" but the unix shell tell me :

cc: Command not found. :mad:

How can i fix this ?
 
yes but i don't want to use them.
In my school i'll be working with the "regular" (= non-MacOS X) Unix and i'll compile with it. I need to use a system as near as possible of the one i'm going to use...
Moreover , i don't exactly konw how to correctly use most of the developer 's tools wich my work far more complicated, because in my school work i'll be working directly with the terminal !

do you know why the CC commands is shut down or absent ?

thank a lot for your response...
 
cc is installed with the Developer tools. It's possible your path isn't set properly in the Terminal. Try typeing echo $PATH in the terminal and post what your path is.
 
hey ! you're right, i haven't install it on THIS mac ! I'm installing it right now, i'll tell you if it's working !

I've a another problem : my apache server down and the unix error message is :

[Belaran:~] belaran% apachectl graceful
/usr/sbin/apachectl graceful: httpd not running, trying to start
Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/belaran.conf
Processing config file: /private/etc/httpd/users/error_log
Syntax error on line 1 of /private/etc/httpd/users/error_log:
Invalid command 'Processing', perhaps mis-spelled or defined by a module not included in the server configuration
/usr/sbin/apachectl graceful: httpd could not be started
[Belaran:~] belaran%

any guess ?
 
:)

I'm not sure about your apache problem. It sounds like there's a problem with your config file though. I suggest you start a new thread about it in this forum if you haven't already.
 
Err...there shouldn't be an error_log in /etc/httpd/users - that's the problem! It's trying to go through that as if it's a config file, but it's a log file and so doesn't have the syntax apache is expecting...that gives you the error you're getting.

Delete the error_log from there, and check your httpd.conf file to make sure it's not saving the error_log there for some strange reason.

Oh and BTW, if your school is using the GNU version of cc (gcc), it's almost identical to Apple's cc - it's based on GNU's gcc with some added options for the Obj-C stuff and whatnot. So pretty much anything you do with it you'll be able to do with the cc you use at school (as long as you're sticking to C and not Obj-C, anyway).
 
Thanks a lot both of you !

About GNu and stuff, you may be found this quite strange but the exploitation system of my school is ... OpenVMS !
:eek:

At some point we're going to use unix , but at for almost two year we only work on VMS (wich is quite a good system by the way)...

I erased the error_log and it's still going wrong !


[Belaran:/etc/httpd/users] belaran% ls
belaran.conf error_log
[Belaran:/etc/httpd/users] belaran% sudo rm error_log
[Belaran:/etc/httpd/users] belaran% ls
belaran.conf
[Belaran:/etc/httpd/users] belaran% apachectl graceful
/usr/sbin/apachectl graceful: httpd not running, trying to start
Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/belaran.conf
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl graceful: httpd could not be started
[Belaran:/etc/httpd/users] belaran%

Obviously there somekind of authorisation problem. I checked the rights with the bacthmod 1.31 freeware and i got this
owner (belaran): R W
Groupe (staff) : R
World : R
why is it unable to open it ? Everybody can !!!
 
Hmm, try giving the file RW to everyone, maybe that's it - though the conf file for my user has the same exact permissions, so I dunno.

It looks like it's dying on the error_log, though. At least this time it's looking in the right place :p

Try this command in the terminal: sudo touch /var/log/httpd/error_log. That should get rid of that error, and apache may start up after that.
 
STill not doing it !
This is quite a mess ! I can't understand how such a big problem as occurs !

Anyway the error message :

[Belaran:~] belaran% sudo touch /var/log/httpd/error_log
[Belaran:~] belaran% apachectl graceful
/usr/sbin/apachectl graceful: httpd not running, trying to start
Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/belaran.conf
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl graceful: httpd could not be started

still authorizations difficulties !
 
[Belaran:~] belaran% ls -la /private/var/log/httpd
total 184

drwxr-xr-x 4 root wheel 136 Mar 28 14:35 .
drwxr-xr-x 38 root wheel 1292 Mar 27 03:15 ..
-rw-r--r-- 1 root wheel 92047 Mar 15 00:18 access_log
-rw-r--r-- 1 root wheel 0 Mar 28 14:35 error_log
[Belaran:~] belaran%

Still confusing....
 
[Belaran:~] belaran% apachectl start
Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/belaran.conf
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl start: httpd could not be started

still this "permission denied" ! this is crazy !
 
I could be wrong however you appear to be logged in as the user Belaran , most likely in the 'wheel' group, the file is owned by root, you give the owner read/write permissions however you do not give the group read write permissions, I would try :

chmod 664 /private/var/log/httpd/error_log
chmod 664 /var/log/httpd/error_log

One or the other...Keep in mind although I am familar with FreeBSD and *nix in general, I am not familar with mac osx, so I' not sure about the whole /private/ prefix on that first one.

However i do believe that you will need to give permissions to the group as well, I could be wrong, it's early in the morning.
 
Anyway thank you nick, i had already tried to change things with chmod without success,
i tried your idea :

Belaran:~] belaran% sudochmod 664 /private/var/log/httpd/error_log
sudochmod: Command not found.
[Belaran:~] belaran% sudo chmod 664 /private/var/log/httpd/error_log
Password:
[Belaran:~] belaran% sudo chmod 664 /var/log/httpd/error_log
[Belaran:~] belaran% apachectl start

Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/belaran.conf
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl start: httpd could not be started

but as you can see same thing again !
I'm afraid that we're all missing something here, 'cause none of us understand where is the problem...
It's appear to be a authorisation problem, but no chmod operation seems to be sufficient...
 
I forget i had already try this, and , we're going to love it, see what i get :

[Belaran:~] belaran% sudo apachectl start
/usr/sbin/apachectl start: httpd (pid 398) already running
[Belaran:~] belaran%

already running !!!!! *%*%*'s already running !!!

I dunno how I end up in this mess but i surely mess it up completly.

... Oh, by the way : i've already tried to re-install the all macos X.2 system !

I believe i try to sudo kill the pid but i'm not sure quite i succeeded ...

I'm still begging for your help
 
Well, try sudo apachectl stop, then do sudo apachectl start. You know, I should have thought of sudo first, the initial apache daemon is usually owned by root. That could make a big difference with those permission problems.

Hmm, you could try sudo apachectl restart rather than a stop/start. Does the same thing, pretty much.
 
Back
Top