# gcc not working



## JadeNB (Jul 18, 2005)

I want to compile something downloaded with Fink from source.  I tried and got an error that I didn't have any suitable compiler.  I installed gcc-4 from Fink without trouble, and then tried again.  It still couldn't find gcc, so I realiased gcc-4 to gcc.  Now it recognised the compiler but said it couldn't output executable files, so I changed the alias back and then tried to install gcc from Apple's developer kit.  It says it installed, but a Spotlight search for gcc and `which gcc' from a command prompt both return nothing (except the files for gcc-4, in the former case).  Any suggestions?


----------



## kainjow (Jul 19, 2005)

Do you have Xcode installed? When you install Xcode, it properly sets up all gcc stuff. It's included with your Mac OS X cd's.


----------



## JadeNB (Jul 19, 2005)

kainjow said:
			
		

> Do you have Xcode installed? When you install Xcode, it properly sets up all gcc stuff. It's included with your Mac OS X cd's.



I didn't want to install the full Xcode, so I just installed gcc.  It insists that it has installed it, but doesn't tell me where it is, and it's certainly not in my path.  (It's also not in /usr/bin.)  Do I have to install the whole thing just to use gcc?


----------



## kainjow (Jul 19, 2005)

I don't know where GCC gets installed, but you most likely will have to add it to your PATH in order to access it normally.


----------



## spb (Jul 19, 2005)

kainjow said:
			
		

> I don't know where GCC gets installed, but you most likely will have to add it to your PATH in order to access it normally.



Xcode installs gcc-3.3 in /usr/bin/gcc which I think is in the default $PATH.  I don't know about gcc-4

You can check your path with the command "echo $PATH"

sb


----------



## JadeNB (Jul 20, 2005)

Thanks for all the help.  It turned out gcc-4.0 was installed as gcc-4.0, not gcc.  I also installed gcc-3.3.  I still couldn't compile anything until I copied one of them to gcc.  When I did so I got the message `Error:  C compiler cannot produce executable files'.  I got this with both gcc-4.0 and gcc-3.3.  Any suggestions?


----------



## lurk (Jul 20, 2005)

You need to run 'sudo gcc_select 4.0' to set up the proper symbolic links.  In just pulling one package out of Xcode you probably missed the bit of the install that does that.   That is Apple's bug I guess, although they never claimed to have things work in the partial install configuration.


----------



## JadeNB (Jul 22, 2005)

I don't know why, even once I created the symbolic link myself, it still shouldn't be able to create executable files, but I finally gave in and installed XCode tools, and it seems to be working fine now.


----------

