1

Greetings!

Since reinstalling XCode this morning, I have been unable to compile any iOS project. Mac OS targets work perfectly fine, but iOS targets just refuses to work. Even the templates included with XCode refuses to compile.

Now, this is probably where I should include my error messages. The problem here is that just the plain templates will output 14300 errors. These errors do not come from the files in the project, they come from math.h, signal.h, stddef.h, stdlib.h, time.h, CFBase.h, CFArray.h and a number of other built in headers. The errors are too many and too different to name, but a lot of them seem to be in this form:

  • Expected * before * : CFBitVector.h:17: error: expected '=', ',', ';', 'asm' or 'attribute' before 'CFBitVectorGetTypeID'
  • Expected * before * : /math.h:470: error: expected declaration specifiers before '__AVAILABILITY_INTERNAL__IPHONE_3_2'
  • GCC 4.2 Error : m/math.h:477: error: storage class specified for parameter 'scalb'

There is an error in one of the project-files: Viewer-Prefix.pch. The file looks like this:

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

The line with "#import " gives these exact errors:

  • Expected '{' at end of input
  • Old-style parameter delcarations in prototyped function definition
  • Old-style parameter delcarations in prototyped function definition
  • Expected '{' at end of input

The current version of XCode is 4.0.2, and iPhone SDK is 4.3. I believe I upgraded from XCode 4.0.0, the first one that came out. As I only get these error messages when compiling for iOS, I thought there might be a problem with my SDK's. System Profiler lists the following SDK's as installed:

Mac OS X: 10.6: (4A2002a)

iPhone OS: 4.3: (8H7)

iPhone Simulator: 3.2: (7W367a) 4.0: (8A400) 4.1: (8B117) 4.2: (8C134) 4.3: (8H7)

Bottom line: I have no idea where to start. I have never had any errors outside any project files, and I have a hard time believing that there are in fact 14300 errors.

Extra facts:

  • Base SDK: Last iOS (iOS 4.3)
  • Architectures: Standard (armv6 armv7)
  • Platforms: iphonesimulator iphoneos
  • Mac OS X Deployment Target: Compiler Default
  • iOS Deployment Target: iOS 4.3
  • C/C++ Compiler Version: LLVM GCC 4.3
4
  • Use the uninstall script to completely uninstall Xcode and then re-install from scratch. Commented Apr 28, 2011 at 16:32
  • in your upgrade to 4.0.2 did you check all the default options? Was there any problem during install? Did you make sure that you weren't running your existing Xcode at the time? In your Build Settings what are the values for Base SDK, architectures, platforms, and deployment target? Commented Apr 28, 2011 at 16:35
  • To uninstall: /Developer/Library/uninstall-devtools Commented Apr 28, 2011 at 18:03
  • A full uninstall & reinstall sadly did not help at all, there are still 14300 errors. Yes, I did check all of the install options. There were no problems, and I did not even touch the computer while I was installing. The main post is updates with base SDK and so on (or should be in a minute) Commented Apr 28, 2011 at 21:22

1 Answer 1

1

Allright, it seems I was the cause of my own problem here. I named the new project "Viewer", and it seems that the name of the project was causing problems. The reason older project did not compile was because I had this "Viewer" project open, and this eventually crashed XCode.

I am curious as to why this happened. One theory is that this creates files with the same name as some of the SDK files, but I do not know to be honest. It would also be interesting to know if any other project names will produce the same results.

Sign up to request clarification or add additional context in comments.

2 Comments

I'd be doubtful that the project name has any effect. My guess is there's something funky with the locations of your project files and frameworks. I'd try starting a new project afresh and careful copy all files to the project directory, then one by one link in all the frameworks.
Well, the weird thing is that creating a project that is essentially the same, but with a different project name, and in the same location, will not produce any errors. Other project names work out just fine, but creating a project named "Viewer" will no matter what give me errors. I have verified this a number of times. You might be right though, that there is something funky with the installation on my Mac.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.