PDA

View Full Version : New to programming. Having trouble with Xcode




chrisc23
Nov 23, 2010, 04:29 PM
Hi there everybody. I have just began to try and start learning how to program and have started with trying to learn how to program in C. I downloaded Xcode 3.2.4 but I have already got a problem that when I write a program in the Command Line Tool I keep getting an error message that says Can't exec ' /Developer/usr/bin/gcc-4.2' (No such file or directory) please help?



HiRez
Nov 23, 2010, 04:33 PM
/Developer/usb/bin/gcc-4.2

That should be usr, not usb.

chrisc23
Nov 23, 2010, 04:35 PM
my mistake usr :)

jerry333
Nov 23, 2010, 06:13 PM
You shouldn't have to have the -4.2 at the end. Just /Developer/usr/bin/gcc because you might not have version 4.2 installed.

To see what is installed:

Note that gcc is a link to gcc-4.2 on my system, but yours could be different.

$ ls -l /Developer/usr/bin/gcc*
lrwxr-xr-x 1 root wheel 7 May 23 2010 /Developer/usr/bin/gcc -> gcc-4.2
-rwxr-xr-x 1 root wheel 97392 Jul 26 13:35 /Developer/usr/bin/gcc-4.0
-rwxr-xr-x 1 root wheel 166128 Jul 26 14:05 /Developer/usr/bin/gcc-4.2

chrisc23
Nov 24, 2010, 12:56 PM
What do I need to do to find out what gcc is on my system? Will a more updated gcc make the error message go away?

lloyddean
Nov 24, 2010, 01:14 PM
From within the Terminal -

gcc -v

chrisc23
Nov 24, 2010, 02:28 PM
From within the Terminal -

gcc -v

I am running gcc 4.2.1

mac2x
Nov 24, 2010, 09:37 PM
Hi there everybody. I have just began to try and start learning how to program and have started with trying to learn how to program in C. I downloaded Xcode 3.2.4 but I have already got a problem that when I write a program in the Command Line Tool I keep getting an error message that says Can't exec ' /Developer/usr/bin/gcc-4.2' (No such file or directory) please help?

Why is it in /Developer? My command line compilers are all in /usr/bin.

Run this and show us the results:

which gcc

[edit] I realize that Xcode's compilers are in /Developer; it seems to me the OP is referring to the command line tools.

jabbott
Nov 24, 2010, 10:21 PM
I have /Developer/usr/bin/gcc-4.2 on my OS X 10.6 system. My guess is that when you installed Xcode, it didn't install gcc there for some reason. I recommend re-running the installer and making sure that every software package is selected for install (you may have to click "Customize" to do this).