Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vighnahara

macrumors newbie
Original poster
Jan 21, 2011
1
0
So I'm taking an intro comp sci course, we're doing C/C++.

I usually use linux, which of course has g++ installed by default. I was rather astonished that it wasn't installed on OS/X by default. Then I was flabergasted when I learned I had to install something that was going to take up 10GB of my hard drive, when all I wanted was g++. I don't need Xcode, I don't need anything fancy for developing software for Macs, we're not doing anything remotely GUI based...

So I'm really confused as to why I can't just install g++ without all the extra stuff from Xcode. My biggest objection is that I only had 20GB free, and now half of that is being used by this crazy huge program.

From what I hear, I can download other c++ compilers... the problem is, I have to make 100% sure it will compile with no warnings or erros in g++, as per our assignment requirements.
 
OS X isn't primarily a programmers OS so installing the compiler by default would waste space on most people's machines. Also note that "Linux" does NOT have g++, or any compilers, for that matter, "installed by default". Whatever distro you are using may very well install it, but your distro != Linux, please learn the difference.

Also, look at finkports, you can download a lot of the tools directly without XCode.
 
After you install the Developer Tools (which includes XCode), you can delete the /Developer folder (6GB on my machine). All the libraries and dependant files for compilation, gdb etc are in a hidden system folder.
 
Last edited:
Sorry, didn't see that you edited the post. Never mind.
 
Last edited:
Very simple explanation: Apple lets you download all the development tools that are needed to write software for Macs, iPhones, iPod Touch and iPad. If that's what you want, that's what Apple gives you. If you want just the g++ compiler, that is none of Apple's business. Note that the gcc compilers are not the recommended compilers for Mac software development anymore, and Apple will never be shipping any compilers later than gcc 4.2.
 
Also note that "Linux" does NOT have g++, or any compilers, for that matter, "installed by default". Whatever distro you are using may very well install it, but your distro != Linux, please learn the difference.

I thought most *nix installations shipped with a base compiler to compile the OS?

I know that new users would always post about missing lib's, etc., when they tried to compile something, because the base compiler is there *strictly* to compile patches for the OS. You didn't get all the extranious lib's without installing the full blown compiler.

Yeah, I may be going back a ways... I never really thought about it until now :eek:
 
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5)

I think the point was Linux is found many places you won't find a compiler. Like an Android phone, Linksys WRT54GL router, behind Chrome OS ...

Even for PCs some distributions, like those designed for Live CDs or "tiny/ damn small Linux" distros are unlikely to ship with a compiler of any kind, while others like Gentoo compile anything they install.

B
 
Waaaaaaaahhhhh, waaaaaaaahhhhh, waaaaaaaahhhhh ...

(While at the neighbors house)

... where's binky ...

... waaaaaaaahhhhh!


Sorry counldn't resist. Thirty plus years of people complaining that their new system isn't setup, or doesn't work like the last one. It gets kind of annoying after awhile!

It's the "tone" of the post more than the question.
 
I don't understand one thing. The OP asked for a way to get gcc without XCode yet people post links for tools that require XCode (note that fink does not have a binary for gcc and Snow Leopard).
 
It appears to be so. The only link in the info file is for gcc source and the install script explicitly invokes make.
 
It appears to be so. The only link in the info file is for gcc source and the install script explicitly invokes make.

The hpc compiler you linked should work fine to get that going though, I use that one for fortran, but as I recall it doesn't support Objective-C/Objective-C++.

B
 
I thought most *nix installations shipped with a base compiler to compile the OS?

Nope. Firstly, not even the most popular Linux distributions have their source code with them anymore. And secondly, if you don't ship any source code, then you also don't need to ship any compilers.

The Perl and Python interpreters and, if you use Gnome, even the Mono runtime are part of the default installation, but not the GNU compiler collection.

In Ubuntu, you have to "sudo apt-get install build-essential" if you want to have the basic tools to compile something.
 
The hpc compiler you linked should work fine to get that going though, I use that one for fortran, but as I recall it doesn't support Objective-C/Objective-C++.

B

You are right! I never tested the HPC compilers with Objective C so I didn't knew that.

Code:
Target: x86_64-apple-darwin10.4.0
Configured with: ../gcc-4.6-20101106/configure --enable-languages=c++,fortran
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.