no g++ without Xcode WHY???

Discussion in 'Mac Programming' started by Vighnahara, Jan 21, 2011.

  1. Vighnahara macrumors newbie

    Joined:
    Jan 21, 2011
    #1
    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.
     
  2. foidulus macrumors 6502a

    Joined:
    Jan 15, 2007
    #3
    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.
     
  3. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #4
    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.
     
  4. balamw, Jan 22, 2011
    Last edited: Jan 22, 2011

    balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #5
  5. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #6
  6. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #7
  7. subsonix, Jan 22, 2011
    Last edited: Jan 22, 2011

    subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #8
    Sorry, didn't see that you edited the post. Never mind.
     
  8. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #9
    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.
     
  9. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #11
    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:
     
  10. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #12
    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
     
  11. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #13
    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.
     
  12. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #14
    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).
     
  13. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #15
  14. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #16
    It appears to be so. The only link in the info file is for gcc source and the install script explicitly invokes make.
     
  15. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #17
    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
     
  16. Winni macrumors 68030

    Winni

    Joined:
    Oct 15, 2008
    Location:
    Germany.
    #18
    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.
     
  17. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #19
    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
    
     
  18. Sander macrumors 6502

    Joined:
    Apr 24, 2008
    #20
    Interestingly though, GCC 4.6 just added a bunch of Objective-C improvements.
     
  19. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #21
    That won't make a difference (it is support for Objective-C 2.0). The gcc compilers apparently changed their license in ways that won't let Apple do what they want to do. Which is why gcc 4.2 is the last gcc compiler that Apple will ever be shipping.
     

Share This Page