GCC without Xcode on OS X - xcode

I've just unwrapped my new MacBook Pro (yay!) and am now setting it up properly for development. Since I want to avoid clutter, I'm wondering if I really need to install the Xcode tools at all (I never use the IDE or Mac specific tools), since I'll install a newer version of GCC anyway, using MacPorts.
So, is there any benefit in installing Xcode? Is it necessary? What kind of set-up does it do behind the scenes? Basically: can I skip this or will it come back to haunt me because some Unix development tools just assume that OS X is always set up in this way?

In order to perform an easy and successful install of MacPorts, already having tools from the xCode installer is necessary. You only need the install option that places a copy of the unix/header files outside of xcode; everything else can remain uninstalled.

A friend of mine recently released this:
https://github.com/kennethreitz/osx-gcc-installer
Have fun :)

I tried this trick and I was constantly chasing missing header files and such. Just install XCode.

We primarily use the Xcode IDE for building Cocoa/Carbon applications. Xcode typically has different project templates (and project settings fixed accordingly). As long as you are not going to generate a Universal Binary or a framework I think you should be ok. As far as I am concerned, when I am too pissed with Xcode, I go back to the command line, set up the paths myself and start using GDB.

First of all, congratulations on the new MBP. I recently bought a 15" unibody myself. =)
You can safely skip Xcode installation, and you can install almost everything Xcode installs through MacPorts, except Xcode itself, of course.
However, I believe you'll find yourself installing Xcode one day anyway, and installing Xcode is much easier than installing all the tools (especially GCC) through MacPorts.

You can strip down the Xcode install quite a lot - when you install Xcode there is a "Customise" button where you can remove a lot of stuff (gigabytes worth).
You can also go in and delete stuff from /Developer/, for example the 10.3 SDK is about 150MB (I think), and if you're not writing software for that it's quite safe to delete. Obviously be careful when deleting, but if you break things, you can always reinstall the Developer Tools!

Apple now provides the command line tools as a separate download from Xcode. They work with Lion and Mountain Lion. You can download them from the Apple Developer Center.
(This is noted on the osx-gcc-installer GitHub page.)

Related

Qt without Xcode

Is it possible to use Qt and Qt Creator on MacOS with Command Line Tools only, i.e. without installing the whole Xcode?
I'm asking because I'm getting "Project ERROR: Could not resolve SDK Path for 'macosx'" and all the solutions I read ask for full Xcode.
I had the same question when I wanted to install Qt on an old MacBook Air that can't run the version of macOS that XCode now requires.
I found this document detailing how to install Qt without XCode.
It does complain about XCode not being present, but as the document notes you can ignore that and proceed anyway.
(Note: solution didn't solve my problem for a couple obscure reasons, but I'm leaving the answer because it is an additional option not yet mentioned.)

Uninstall xcode but keep other dependencies

I do not work on iOS or OSX apps, but I do a fair amount of other development. Therefore, I need to keep things like python, gcc, etc. How can I uninstall the xcode app without removing these other things?
How can I uninstall the xcode app without removing these other things?
First point to note is that python comes pre-installed on your mac and can be interacted with independently of Xcode.
You delete the Xcode application from your applications folder (/Applications) and leave the developer tools in place. This would leave the command line tools in place, you could call this a bit of a hack.
location of command line tools:
/Library/Developer/CommandLineTools/usr/bin/
Completely remove Xcode and command line tools and use a package manager tool like HomeBrew to install the tools you require.

../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type

I have been using RapidSVN on a Linux machine for the past few years - it has become an excellent tool for managing my source.
Yesterday my trusty Linux laptop had a couple of strokes so I decided it was time to replace it. Today I went out and purchased a new Mac Book Pro with the flashy display and solid state drives.
Then I went hunting for an SVN tool to run on Mac. I found that RapidSVN will run on a Mac as it was developed using wxWidgets (cross platform windowing).
So, I needed to install wxWidgets, however this doesn't come as an executable so I had to download the tar ball. To compile I realised I don't have a compiler installed yet... so, install Xcode 4.4, then learn that doesn't install a compiler either... find the Xcode preference to install the command line tools (compiler).
So, now I have Xcode installed, a gcc compiler, and tracking back up it comes to wxWidgets. It takes a little working out but I manage to extract the files into a directory in my home folder, (following instructions of course), and from the 'build' folder I run the ../configure command (which seems to work) and then the 'make' command which fails:
In file included from ../include/wx/mac/private.h:4,
from ../src/common/dynlib.cpp:48:
../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type
../include/wx/mac/carbon/private.h:1488: error: ‘ClassicCursor’ does not name a type
make: *** [baselib_dynlib.o] Error 1
So I go hunting for a solution only to find this bug: http://trac.wxwidgets.org/ticket/14536 which unfortunately indicates this is not going to be fixed.
Changed 10 months ago by csomor
* status changed from new to closed
* resolution set to wontfix
A dismal day in the land of computers. I am now stuck for the next 5-6 years on a computer that will never be able to compile anything using wxWidgets - I rather feel like taking it back to Apple and getting my money back.
So where to from here? Is there a binary version of wxWidgets available? Is there a binary version of RapidSVN available? Should I downgrade to OSX 10.x something less than I am currently on? Should I upgrade to unstable wxWidgets?
This is an interesting but not very understandable read. What exactly are you trying to achieve? If you're looking to use the best available version of wxWidgets under OS X, get 2.9.4 or the current svn version and build it using the Xcode version you have already with Cocoa support. If you absolutely need to continue to use Carbon (why?), either install Xcode 3, available from Apple, or get 10.6 (or 10.5) SDK in some other way and pass it as the SDK to use to configure using --with-macosx-sdk option as explained in the documentation.
VZ is right. If you need to use wxWidgets 2.8 on OS X (and there are legitimate reasons for needing to do so), get the 10.6 SDK. Copy it alongside the already installed 10.7 and/or 10.8 , and select it in the project/target's build settings.
From here I have given up trying to compile anything on my current OSX. I am not going to downgrade or install multiple versions of different libraries in order to satisfy the lack of support for the latest current stable versions.
From here I will download and install binaries only.
I have Mac OSX Lion and just did this:
brew install wxmac
and was able to get through the install with no issues.

How to uninstall xcode3 from Lion 10.7?

I have just bought a macbook air 11" with Lion 10.7. I installed xcode 3.2.5 on it. But its not working. Xcode is installed, consuming much space but I cannot see it in applications. Somewhere I heard that xcode 3 will not work on Lion 10.7, only xcode 4 is compatible on this os. Is it really true? I tried removing xcode 3 but efforts go worthless. What should I do to uninstall it?
For Xcode, you want to use scripts provided with Xcode to remove it completely. Open a terminal window and invoke /Developer/Library/uninstall-devtools. Alternatively, you can just drag the Developer folder to the trash, but I don't think that removes everything that gets installed by the installer.
And no, Xcode3.2 won't work (entirely right) under Lion. You need Xcode4, v4.2 being the most recent with the iOS5 SDK. And if you want to submit anything to Apple, you'll need 4.2 (i.e. the latest released tools) anyway, at this point.
I would use this utility. It's always worked better than the traditional way to "unistall" applications form OSX
http://appzapper.com/
The reviews have always been good for this app.

Xcode 4 + Git - Useful for me?

I've always searched for a decent visual diff tool for git diffs and merges and have never found one that is both great to use and stable... I've noticed that Xcode 4 has git built in now so was wondering how I could use both for my work.
So question 1)
I only do web dev, no OSX or iOS apps... but is there a way I can tap into Xcode to use their visual diff tool maybe?
question 2)
Without realising git was bundled, I installed Xcode (so Homebrew works) then installed git separately with "brew install git". Have I now doubled up and do I need to delete the one I installed with Homebrew?
question 3)
Would Xcode be any use to me for any reasons that I haven't noticed? would it be any use for project handling or anything?
Many thanks :)
1) Xcode ships with with its own three-way merge tool: /Developer/Applications/Utilities/FileMerge.app/ I haven't used Git in Xcode much but I bet that's the tool they use for doing diff/merging.
2) You doubled up but don't worry about it, many times people will install newer versions of OS X supplied tools (just make sure not to overwrite the one supplied by OS X.)
3) If you're not doing OS X/iOS development, I don't see Xcode being that good for you. The editor in Xcode leaves a lot to be desired in my opinion.
My two cents. :)

Resources