Where is gcc on OSX? I have installed Xcode already - xcode

I have installed Xcode from the Tool cd, I thought that would let me use gcc from the command line but I can't find it.
What am I missing
EDIT
When I wrote I can't find it I meant "I look for it using which gcc"
If gcc would have been in the PATH in first place, which would have find it.
Since gcc is not in the PATH ( that's what brought me here in first place ) which won't find it!
I think that was obvious but I'm making the note here because it wasn't

As of version 4.3.1, XCode is now an application and the command line tools are now available through the Preferences (this is documented in the App Store for XCode under 'What's New in Version 4.3.1' if you click 'More...'). After installing XCode, open it, open the Preferences and click on the Download tab. Click on 'install' for the 'Command Line Tools' and then sign in with your computer's password. The code will then be downloaded and installed.

You didn't check the box that says "UNIX Development Support"[1] (or possibly you unchecked it; I can't remember if it's on by default or not) when you did the install, so it didn't install the necessary symlinks and drivers in /usr/bin/.
Reinstall, and make sure to read the descriptions of the configuration options and select the ones that you need.
1: "Optional content to allow command-line development from the boot volume. Installs a duplicate of the GCC compiler and command line tools blah blah blah..."

Something went wrong with your install.
gcc is installed under /usr/bin with a symlink to gcc-4.2:
cd diciu$ pkgutil --file-info /usr/bin/gcc-4.2
volume: /
path: /usr/bin/gcc-4.2
pkgid: com.apple.pkg.gcc4.2Leo
pkg-version: 4.2.0.9000000000.1.1249367152
[..]
pkgid: com.apple.pkg.Xcode3.2.1Update
pkg-version: 1.0.1.1249367152
[..]
pkgid: com.apple.pkg.Xcode3.2.1UpdateUNIXDevSupport
pkg-version: 1.0.1.1249367152
[..]

On my Mac $ which gcc displays /usr/bin/gcc.

Xcode 4.3+ you need to install 'Command Line Tools for Xcode' found here: https://developer.apple.com/downloads

Is it possible that rather than not having gcc installed, your $PATH variable is messed up? first check if gcc is in /usr/bin manually. Then echo $PATH...

The same thing happened to me. It worked for a while and then went away. Reinstall and it will be fixed.
You might want to download Xcode from Apple while you are at it. Almost guaranteed to be fresher / more up-to-date since Xcode is rapidly updated. Current Xcode is 3.2.1.10. You need an Apple ID to download, but that also gives you access to the development site. All free... .
It is 1/6/2014. Current Xcode is 5.0.1
It is 2016 -- Current Xcode is 8.0. I think this question should be closed now.

Yes, try to install 'command line tools' by clicking Preferences-Downloads-command line tools.

Related

XCode 4.3 Command Line Tools Package with Invalid Checksum

The package Apple provides to install the command line tools with Xcode 4.3 is corrupted, and I seem to need it because I'm developing some command line tools.
Has anybody found an alternative Command Line package for Xcode 4.3 from Apple that works or an workaround for the subject?
Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators.
So, I found a way to do this correctly.
The problem is really in one of the European mirrors from Apple.
The workaround is to:
- Install Tor: https://www.torproject.org/
- Choose a Tor node in the USA
- Logging into your Apple Developer account and download the package
It now opens correctly without any checksum warning.
I solved my own problem of downloading/installing Xcode 4.3.1 "Command Line Tools" by getting them directly from the developer's webpage. The March version yielded a checksum error just like
the download from within Xcode 4.3.1, i.e. Xcode/Preferences/Downloads . But I did have success with the February version of CLT. I don't know why things were out-of-sync.
I had the same problem when trying to install the Command Line Tools from the Downloads tab in the XCode preferences (also downloading from Europe). I fixed it by clearing the dns cache on my system.
This is the Terminal command to clear the dns cache (OSX Lion):
dscacheutil -flushcache
Restart XCode after running this command, it may not fix the problem with the checksum until you do.
try:
defaults write com.apple.frameworks.diskimages skip-verify -bool true
Just add another mirror for the download site:
Use the following to determine a valid ip:
http://www.webmaster-toolkit.com/dns-query.shtml?address=adcdownload.apple.com
and add this to /etc/hosts:
adcdownload.apple.com
Example (ip might already have changed)
64.211.144.168 adcdownload.apple.com.
You can simply click skip while the disk image is verifying. I have installed from a dmg of CLT-4.3 with this problem and built an extensive amount of software with if successfully on my te

How to install native assembler for Mac OSX?

I am interested to know how can I install native assemblar (I think also known as AS) on Mac OSX Lion. Someone suggested that I can use the Xcode to do it but I didn't see any options.Terminal windows is not able to recognize AS as command right now. Can someone provide more insight on this ? I am new to Mac/Unix environment so please provide help accordingly.
If you have Xcode installed, then you have as.There is no option to install specific packages from the Xcode installer.
as should be in /usr/bin/:
ls -l /usr/bin/as
If not, you probably have a problem with your Xcode installation.
Otherwise, also check your PATH environment variable, to ensure /usr/bin/ is in the list.
echo $PATH
If you've installed Xcode 4.3, it doesn't install the command line tools anymore. To get them, you have to launch Xcode, go to Xcode > Preferences... > Downloads tab, then click the 'Download' button for 'Command Line Tools'. You'll need to sign in with an Apple Developer ID.
Using Xcode 4.6 with Command Line Utilities installed
export PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
as will execute along with the other command line utilities.

Getting gcc to work with Xcode

I am at a place where I don't have the installation CD or the bandwidth to do a full Xcode install (It would take well over a day) to get gcc. However I did install xcode and I notice in Developer/Xcodefiles/usr/bin/ that there is gcc. When I click on it, a terminal opens up and exits complaining no input file. Is there any way I can salvage this? man gcc says no manual entry for gcc.Thanks in advance for the help.
If you want only gcc on OS X go here: https://github.com/kennethreitz/osx-gcc-installer

XCode: Where is GCC installed?

I've installed XCode v3.1.3 and am having difficulties using the rumored GCC that is installed along with it. -- I'm certainly able to use the XCode IDE to compile my programs but would like the flexibility of also using the command line...
Where's GCC?
Look in /Developer/usr/bin
The most likely explanation is that when you installed the Developer tools you unchecked "UNIX Development Support", so the command line tools were never installed. Delete your /Developer/ directory and do a clean install of the tools; make sure to select "configure" during the installation process and ensure that the appropriate items are checked.
In /usr/bin you should find gcc-4.0 and gcc-4.2 and then there will be a symbolic link gcc which points to one of these (usually gcc-4.2).
As always, you can find out where any available command in your PATH is located using which, e.g.
$ which gcc

Unable to build mercurial on OSX - Python.h not found

For what I've read I need Python-Dev, how do I install it on OSX?
I think the problem I have, is, my Xcode was not properly installed, and I don't have the paths where I should.
This previous question:
Where is gcc on OSX? I have installed Xcode already
Was about I couldn't find gcc, now I can't find Python.h
Should I just link my /Developer directory to somewhere else in /usr/ ???
This is my output:
$ sudo easy_install mercurial
Password:
Searching for mercurial
Reading http://pypi.python.org/simple/mercurial/
Reading http://www.selenic.com/mercurial
Best match: mercurial 1.5.1
Downloading http://mercurial.selenic.com/release/mercurial-1.5.1.tar.gz
Processing mercurial-1.5.1.tar.gz
Running mercurial-1.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_7RaTq/mercurial-1.5.1/egg-dist-tmp-l7JP3u
mercurial/base85.c:12:20: error: Python.h: No such file or directory
...
Thanks in advance.
I was struggling with this problem all day today.
I eventually discovered a site that claimed that all one needed to do was to reinstall Xcode, or install the latest version (4.3.2, as of this writing).
So I tried that. It did not help; not on its own. But then I went a step further: I fired up Xcode.app, and once I had done that, I opened the Xcode..Preferences menu item, and then go to the Downloads tab, and say that you want to install the "Command Line Tools"
Once I did that, and then re-ran easy_install (in my case I was trying to "easy_install dulwich" to satisfy a hg-git dependency), it was able to properly find Python.h for me.
Might depend on what version of Mac OSX you have, I have it in these spots:
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
Also I believe the version of python that comes with Xcode is a custom build that plays well with xcode but you have to jump through some hoops if you use another dev environment.
Are you sure you want to build Mercurial from source? There are binary packages available, including the nice MacHg which comes with a bundled Mercurial.

Resources