small medium large xlarge

Generic-user-small
15 May 2011, 06:26
Glen Warner (3 posts)

Okay, so I’m horribly embarrassed.

I created a new project, named it TextApp as directed, and did nothing else … but when I tried to run the app, I got a build error! :o(

I’m running XCode 3.2.3 under Mac OS 10.6. No idea what to do from here; not even sure how to dig out the build error.

Generic-user-small
15 May 2011, 08:15
Glen Warner (3 posts)

Okay, I figured out how to access the error codes. It says “GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file main.m).”

Well, that’s more than I knew before …..

Generic-user-small
15 May 2011, 22:25
Tim Isted (105 posts)

If this is from a project created by your copy of Xcode, so it uses its own copy of the project templates, this is very strange. Did you have an older copy of Xcode installed previously?

If you had a previous Xcode version installed, I’m concerned that you’ll find the files it uses don’t match with what’s expected in the book. For example, is there are a @MainMenu.xib@ file, or is it called @MainMenu.nib@ - note the difference in extension. If it’s @nib@, then an older copy of the Xcode templates are hanging around, and I’m afraid you’ll need to follow the steps outlined in the book in the “Installing Xcode” appendix in order to remove both your current install and any old files. If you’re using the first printing of the book, the commands to execute in the Terminal have extra spaces between the dashes - they should read e.g. @sudo blah/blah/blah –mode=all@. Alternatively, take a look at this old thread: http://forums.pragprog.com/forums/132/topics/3371 From about half-way down, it covers getting rid of the old files.

If you didn’t have a previous Xcode version installed, then this is a very odd problem. It should be easy to fix by double clicking on the project icon entry itself in the Groups & Files list, and looking at the Build Settings. If you type 10.4 in the little search field, you should find it leaves the Base SDK setting under Architectures, and possibly others like Mac OS X Deployment Target. If you click on where it says Mac OS X 10.4 next to these, you can use the popup to change it to Mac OS X 10.6. My concern, however, is that this shouldn’t be happening in the first place!

Generic-user-small
02 Jun 2011, 19:24
Glen Warner (3 posts)

Hi, Tim.

Thanks for getting back to me.

I removed all the developer tools as directed in the appendix in your book, then downloaded version 3.2.6 of Xcode, and waited until after I rebooted to run the installer.

I then rebuilt the project and (yes, you guessed it …) got another build error. This one says “error: There is no SDK with the name or path ‘/Developer/SDKs/MacOSX10.4u.sdk’”

… which is odd, because I specifically did NOT select anything related to Tiger.

That said, I followed the instructions in that last paragraph, and got the app to build! Thanks! Now I can get on with this business of learning Objective-C and Cocoa ….

You must be logged in to comment