Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to install gcc in OSX without installing Xcode?

I've googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc and none of the other junk that comes with Xcode. And at this point, I'll take any other kind of C compiler.

I know I could simply install Xcode, but that is beside the point since I neither have my original installation disc nor a quick internet connection.

So... does anyone have any suggestions?

EDIT: Sorry if I was unclear, but I need the headers as well. I'm currently installing gcc4 via fink and it's downloading the shared libraries as well. I'll update on the progress.

EDIT 2: Ok, so I successfully installed gcc using fink. BUT, it's pretty much useless: "error: C compiler cannot create executables". After googling around, I found that not having Apple's Developer Tools installed is the cause of the error. Probably because I need all the libraries, headers, etc that are only available through Xcode.

like image 490
aryo Avatar asked Sep 22 '08 13:09

aryo


People also ask

Can you install Git on Mac without Xcode?

Here's a way to install git on Mac OS X without XCode. Adding the directory to the path will prevent Mac OS X from aksing you to install XCode each time you type git in the terminal. Credits goes to Bobby Allen and to GoZoner's answer on SO.

Can gcc be installed on Mac?

This is a guide for installing GCC 5.1 on a Mac using MacPorts. It will likely work for later versions of GCC as well. Just substitute "gccx" for "gcc5", where "x" is the desired version. Download and install Xcode from the Mac App Store.

Can you code on Mac without Xcode?

You can write code even in Windows or Linux, but you can't build and sign it there. Non-native platforms, like Flutter or React Native, won't make iOS builds without Mac either. Storyboards can be edited only in Xcode, so development without Xcode means development without Storyboards.


2 Answers

Checkout command line tools for Xcode from apple. It's official support from apple to only create the command line tools.

like image 66
Amir Raminfar Avatar answered Sep 30 '22 15:09

Amir Raminfar


Try the osx-gcc-installer on github.

like image 39
ergosys Avatar answered Sep 30 '22 17:09

ergosys