OSX 10.7 Precompile Errors in new Xcode Projects - xcode

I'm trying to build a new Xcode project targeting the 10.7 Mac SDK (and using llvm 3.1) and am getting a lot of parse errors during the precompile phase.
All of the Cocoa Foundation files are causing parse errors e.g.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:525:174: error: expected function body after function declarator
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h:68:43: error: expected ';' after top level declarator
CF_EXPORT const CFStringRef kCFErrorURLKey CF_AVAILABLE(10_7, 5_0); // Key to identify associated URL in userInfo. Typically one of this or kCFErrorFilePathKey is provided.
If I switch back to using 10.6 everything seems to compile and run fine.
I've attempted to remove and re-install dev tools using:
sudo /Developer/Library/uninstall-devtools -mode=all
... and then re-installing Xcode 4.3.1, but my 10.7 builds of any new project still fail.
Has anyone seen a similar issue with Xcode 4.3+ and the 10.7 SDK. And what other steps should I try and take to clean/install the dev tools/Xcode?
I've uploaded the build log to http://pastebin.com/ahYzhrww.

I ran into this not too long ago. These steps resolved it for me:
Remove Xcode.app from /Applications
Rename /Developer to /Devoper-old
Reinstall Xcode from the Mac App Store.
In XCode, open the Xcode menu and choose Open Developer Tools, More developer tools...
to download the rest of the developer tools.

Related

Uninstall Previous XCode and Install XCode 4.5

Is it safe to completely uninstall previous version of XCode and Install the XCode 4.5? because...
I just uninstalled XCode 4.2, and it mostly removed all the files in the Developer Folder, now I installed the 4.5, but it scares me since there is nothing in the Developer Folder.
Would XCode still be working even if that's the case? Thanks
Xcode 4.4+ was designed to be installed via the App Store and now stores everything in the Xcode.app bundle in your /Applications directory.
Make sure you use xcode-select to select the new path for your Xcode installation, and you install the command line tools from within Xcode 4.5.
From the Xcode 4.5 release notes:
Starting in Xcode 4.3, the Xcode.app file package contains all the Xcode developer tools. The man pages for the command-line tools Xcode uses are also placed in this package.
yes It's totally safe to completely uninstall the previous Xcode and install new Xcode4.5. I have done it and all works fine for me.
Just have to install the command line tools after installing the Xcode4.5 from it's preference just as show in below image :)

Xcode 4.3 with Eclipse, CUDA, problems?

I understand that the /Developer folder no longer exists after installing XCode4.3. To me, this seems it would have bad consequences. First, CUDA installs into /Developer/GPU_Computing. Second, what happens to the GCC keychain? Eclipse relies on the GCC keychain command line tools, which I'm told disappear with Xcode 4.3.
Can someone shed light as to whether they have dealt with either of these problems?
Xcode 4.3 changed a lot.
Starting from the version 4.3 XCode became a standard Mac OS X application(it reside in the Application Folder), so you can try to move the GPU_Computing under the new root folder of XCode. However i think that an updated version of the CUDA SDK you add support for the new Xcode folder structure.
XCode and Apple are moving towards the new LLVM compiler, so GCC still supported for now, but it will disappear in next releases, so you should migrate to LLVM as soon as you can ...
You can still use GCC with eclipse installing Command line Developer Tools package .
You will have to install command-line tools package.
Run Xcode, open Wcode->Preferences..., and on "Components" tab on the "Downloads" screen select "Command line tools".
I can build and run CUDA Toolkit samples with that package installed.

MonoMac projects cannot compile: ibtool exited with code 1 - Can't run /Developer/usr/bin/ibtool (no such file)

I'm moving my first steps in MonoMac.
But I stopped right at the beginning due to some configuration error. I've created a new ManoMac project in MonoDevelop, and then tried some other sample MonoMac xamarin projects from GitHub, but I always get this error compiling:
Error: Can't run /Developer/usr/bin/ibtool (no such file).
ibtool exited with code 1
My configuration:
Operating System:
Mac OS X 10.7.3
MonoDevelop 2.8.6.5
Runtime:
Mono 2.10.8 (tarball Mon Dec 19 17:43:18 EST 2011)
GTK 2.24.5
GTK# (2.12.0.0)
Mono for Android not installed
Apple Developer Tools:
Xcode 4.3.1 (1176)
Build 4E1019
Monotouch: 5.2.5
MonoDevelop.MonoMac 2.6.0.0
All my Monotouch projects compile fine, and I have no problem with the last XCode (following the Xamarin guidelines I successfully upgraded XCode and moved it from the obsolete Developer folder to the Application folder, and downloaded the updated developer command line tools from apple).
I've tried reinstalling MonoDevelop, but with no success. I always get: "Error: ibtool returned error code 1."
Any help is appreciated.
This problem is caused by the Xcode 4.3 installer not updating the Xcode symlinks correctly to point to the active Xcode version. You can fix it with the following command:
sudo xcode-select -switch /Applications/Xcode.app
This upcoming MonoDevelop 2.8.8 release contains a fix for this. You can get it from the beta update channel.
It looks like the MonoMac addin was never updated to work with Xcode 4.3.
A temporary workaraound is to setup symlinks in the proper places in /Developer.
I found the way in the MonoMac forum:
http://mono.1490590.n4.nabble.com/MonoMac-and-XCode-4-3-ibtool-error-Solution-td4403822.html
I report it here:
When using MonoMac and Xcode 4.3, the current MD beta build fails with an ibtool error.
The solutions is to type the following commands in the Terminal console:
sudo rm /usr/bin/ibtool
and then:
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool /usr/bin/ibtool
Now it compiles fine.
I got a similar error running Xamarin on Xcode 6.2 and I solved the problem by re-installing the same version of Xcode again replacing the old version per the suggestion on this post: xcode-select active developer directory error on OSX Mavericks.
I may have caused this problem as I was renaming XCode Application. I have several versions installed and was trying to keep them all straight.

Xcode Unable to determine compile to use

I recently installed Xcode 4.2.1 and attempted to create a simple "HelloWorld" application in C++. When I went to build to application I received the following:
Unable to determine compiler to use - the abstract compiler specification is missing from this Xcode installation.
I've uninstalled and reinstalled with no success.
I haven't been able to find and resources on the internet to help me resolve this.
I'm running Lion (upgraded from Snow Leopard).
Just copy Developer Folder for Xcode 4.2.1 from another Mac Machine and run Xcode from copied developer folder(/Developer 4.2.1/Applications/Xcode).That will work perfectly.

How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work

When I try and install MacPorts it complains
'Xcode is not installed, or was installed with UNIX Development (10.5+) or Command Line Support (10.4) deselected.'
I do have Xcode installed from the Appstore so I guess I just have to install these extra parts but how ?
Ive read a couple of questions on Stack Overflow about this but I think the answers must be outdated as they do notmake sense for me, I do not have an Xcode dmg I can reinstall from, and I can't see anything useful in /Developer either, or any preferences within Xcode itself.
I only want Xcode for the purposes of using Macports so I'm not familiar with it.
You probably got Xcode 4.1 from the Mac App Store. In that case, you haven't got Xcode 4.1 installed. However, you now have an Xcode installer in your Applications directory.
Spotlight should find it in any case.
The command line tools aren't included in the default install of Xcode anymore.
Goto the Xcode Preferences --> Downloads Pane --> click the Install button beside "Command Line Tools".
If you don't have Xcode installed you can get the command line tools separately as explained here..
http://osxdaily.com/2012/07/06/install-gcc-without-xcode-in-mac-os-x/
The App Store installs the XCode installer, not Xcode itself. The installer is in your applications folder. Run that.
Today, 16 Feb 2012, when I installed Xcode 4 from the App Store, there was no Setup. Just the app installed, because it was Xcode 4.3 !
Make sure that you install Xcode 4.2 with UNIX Devel. to MacPorts works!
To get the Xcode 4.2 go to https://developer.apple.com.

Resources