Learn C on the mac questions...

Hello everybody,
I'm just starting to learn programming. I choose to start with the book Learn C on the Mac - Dave Mark.He wrote the book while using xCode 3.1
I have 2 questions.
First: Every Project that came with the book, when i  try to open one in xcode after build and run it brings the error "There is no SDK with the name or path 'macosx'
Second: The book talks about Syntax and Semantic errors and how to produce then to learn from it so suppose to apperar something like "error: syntax error before '{'  token"  but Xcode only give me "Expected indentifier or '('
Are those because my version of Xcode (3.2.2) or I'm doing something wrong?
I will appreciate your answers and comments.
Thanks

Your first problem is caused by the book projects using an older version of the Mac OS X SDK that you do not have installed on your Mac. The fix is to set the Base SDK for the projects to one that is installed on your Mac. In Xcode 3.2 choose Project > Edit Project Settings to open the project inspector. Select the General tab in the inspector. Use the Base SDK for All Configurations menu in the inspector to set the SDK. You should set it to Mac OS X 10.6.
Regarding your second question, I would not worry about the compiler error message not matching exactly what the book says. What is important to know that you have a syntax error, why you have one, and how to correct it. I assume the book explains the why and how.

Similar Messages

  • Learning Programming on the Mac

    Hi All
    I have decided to learn programming and hopefully turn it into a career. This current economy is killing off my current trade. I would be starting from scratch as I have very limited understanding of programming, or the fundamentals. But I have a very strong Mac and general computer skills.
    From my research I've decided to learn C then C++. So I've picked up The C Programming Language Book (Dennis M Rictche) and Programming Principles and Practices Using C++ (Bjarne Stroutruup). As well I will be entering a collage course.
    I am giving myself about 3 months to get comfortable then start designing some software of my own creations. Plus creating software for other platforms.
    Software for the Mac is it necessary to learn Object C? And would only having a PPC Mac be a limitation of learning the languages, as this is all I have at the moment. It does run 10.5. I will install Xcode as well. Is there anything else in terms of setting up the computer to learn and create software that I need to do?
    Thanks

    Hey, Knitsu -- I know you've since asked this question in a separate thread (welcome to the forums by the way!), but I wanted to touch on one point that you mentioned here. By the way, good for you for looking up and old thread and reading through it -- not enough people do that before they post a new thread (myself included).
    but from my understanding, just looking up eduation learning in the toronto area, most schools have this object oriented programming and C learning for windows systems. Now would this be OK to learn, and still be able to use in the MAC environment IE: with Dashcode and Xcode?
    First off, Dashcode is just for developing Dashboard widgets, so that's the only thing you would be using that for -- Xcode is the main Mac IDE that you'll be using to develop your applications, in addition to Interface Builder. You write your code in Xcode, and you put together your GUI (graphical user interface) in Interface Builder.
    Secondly, to answer your question about learning on Windows and whether or not it will apply to Mac programming, the answer is yes, and no. As far as the C language goes, the answer is yes, more or less. If you take a class for learning C on Windows, what you learn will be directly applicable to Mac programming. The C language is the same language, whether you are programming it on Mac OS X or on Windows. That being said, there will be some differences in the overall experience of programming C on Mac versus on Windows. For that reason, if you take a class on C using Windows, I would buy a book on C programming on the Mac to read along with your course to help you apply what you are learning to the Mac. For this I would recommend the Apress book "Learn C on the Mac", since it is the best book for beginning Mac programming anyways, in my opinion (see my post in the thread you started).
    Now, as far as a class on object-oriented programming goes, your C class won't cover this, since C is not an object-oriented language. If you take a Windows-based class on OOP (object-oriented programming), it will probably teach it to you in the context of C++, if you're lucky, but more likely pseudocode. Pseudocode is code that simulates a real programming language, but it isn't -- it's just English words put together to teach you how programming works on a basic level. Personally, I think this is an absolutely horrible practice, since it tried to teach you programming without teaching you a programming language, which is not only less effective (for most people, in my opinion), but a waste of time as well, since that time could be going to learning a real language like C. Pseudocode might look like this:
    if this = that then
    write "this string"
    end if
    Something like that (I'm not a master of pseudocode -- I took one class on OOP that taught using it a ways back). Anyways, for this reason, it would be much better if you could find a class that taught OOP using a real language, which would probably be C++ if it was a Windows-based class. C++ is a superset of the C language, which means that it has everything C has plus extra (the "extra" here is object-oriented support, so C++ is kind of like an object-oriented version of C, although it also adds other features as well), and C++ is the OO version of C that Windows programming is likely to use.
    Now, Mac OS X allows developers to use C++ as well, but Mac has its own superset of the C language that it prefers you use instead of C++ -- it's called Objective-C. Objective-C is a superset (an extension) of the C language, much like C++, but the main difference (besides the fact that it's a different language) is that Objective-C, unlike C++, was designed with Mac programming in mind. For this reason, it would be best for you to go about learning object-oriented programming using Objective-C. However, the concepts you learn in a class on object-oriented programming using C++ (or even pseudocode) will still be applicable to Mac programming. The language won't be, but the concepts will be. In other words, you will still have to go back and learn OOP through Objective-C at some point, but the concepts you learned in your C++ or pseudocode Windows-based class will help you do so, since all OO languages revolve around similar concepts (objects, in particular).
    I hope this helped to answer some of your questions, and best of luck with your journey toward Mac programming!

  • Learning Unix on the Mac

    What is a good book to own for someone that knows a little Unix (just a little) and used to be pretty good at DOS back in the day. I want to teach myself Unix and learn all the commands, what book do you recommend? Are either of these books worth owning?
    Mac OS X UNIX Toolbox 1000+ Command | Christopher Negus
    The Mac OS X Command Line: Unix Under the Hood | Kirk McElhearn

    Kirk McElhearn seems to be more of a true Mac-person than the other author. The 1000+ books looks just like the Linux version of the same name. Another option is MacOS X for Unix Geeks.

  • Icc profiles on the mac questions

    There seem to be multiple locations in OSX for icc profiles. I've found them in system/library/coloursync, library/coloursync and user/library/coloursync. Both display and printer profiles seem to be mixed up in these 3 locations.
    Is there a preferred location for different profiles - or does Aperture/OSX find things as required (ie, it 'just works') ?
    Also - my lab sent me its .icc profiles which I've copied into my system/library/colorsync/profiles directory. Aperture seems to find them okay. Are .icc files universal (ie, mac and PC) ? I didn't specify that I was a Mac user when I requested the icc profiles.
    Paul

    There seem to be multiple locations in OSX for icc
    profiles. I've found them in
    system/library/coloursync, library/coloursync and
    user/library/coloursync. Both display and printer
    profiles seem to be mixed up in these 3 locations.
    Is there a preferred location for different profiles
    - or does Aperture/OSX find things as required (ie,
    it 'just works') ?
    [snip]
    I cant' speak as to whether display and print profiles should go in different places, or Mac vs. PC profiles, but the general rules for which Library folder to use are:
    /System/Library: Don't mess with it. If an installer puts stuff there, that's fine, but the /System folder and all its contents should be considered hands-off at the user level unless you know what you're doing (the greatest ability to screw up the system comes from mucking around in the /System folder).
    /Library: Files (in this case ICC profiles) put in this folder's subfolders will be available to all users of the computer.
    /Users/Username/Library: Files put in this folder's subfolders will be available only to the user specified. Other users will not have access to them.
    So basically, if you have multiple users on your Mac and you want them all to have access to the ICC profiles, put them in /Library/ColourSync/Profiles. If you only want yourself to be able to use them, they go in /Users/your username/Library/ColourSync/Profiles.
    If you only have one user, and will never add any users to the computer, then placing things in /Library or /Users/username/Library will always yield the same results - you'll always have access to them.
    You probably haven't broken anything by putting the other ones in the /System/Library/ColourSync/Profiles folder, but you may want to take them out and put them in the appropriate place, for consistency.
    Also remember that the user's Library folder is checked by applications first, then the /Library, and lastly the /System/Library. That's the magic of how it "just works" no matter which Library you put the files in.

  • My mac's keyboard is not working with my mac.the green light blinks and i cannot get onto my mac. everything on the support questions does not help because i cant go on the mac and i cant sign in

    my mac's keyboard is not working with my mac.the green light blinks and i cannot get onto my mac. everything on the support questions does not help because i cant go on the mac and i cant sign in

    If you can't sign in, then you can't troubleshoot and/or pair the keyboard until after that........ so, for that, you will need to borrow someone's USB wired keyboard in order to get signed in and to the Keyboard Bluetooth Preferences.

  • HT204053 Mistakenly I changed my Apple ID when I left Italy for UK. when I want to update application for my mac and iPad, they ask me for the old ID password which I have forgotten At the same time I have forgotten the answers to the security questions e

    After having created an apple ID with Italian itunes I moved to UK and I mistakenly created a new Apple ID. However, when I want to update the application on my Ipad and mac computer I am asked fo the old password which I have fogotten. I have also forgotten the answers to the security questions. I made a mistake also with the email i gave and so i cant verify a new password that i want to create. How can you help me?

    Normally you need to call Apple Care for the country where the ID is located. You have changed countries and complicated it by making a new ID. I don't know what to suggest beyond calling Apple Care for Italy and asking them to help you recover the old ID.

  • Looking for software that allows you to make "who wants to be a millionaire".  Must be able to put in your own questions and HAS to be for the Mac.  Help!

    I am a teacher who would love to create the game "who wants to be a millionaire" with my own questions.  I would use this for test reviews.  I can't not find something for the mac.  It is out there for the PC, but my class room is mac based.  I can't use anything that will allow me to run the mac in windows, either.  Anyone know of a software that will allow me to input my own questions?  Thank you very much for your time and consideration.

    You may possibly find something here:
    http://www.oneonlinegames.com/who-wants-to-be-a-millionaire-games
    but in any case beware of copyright.

  • I had a windows laptop, and I save files like photos, documents, videos and other things on an external hard drive, and now I want to move those files to the Mac book Pro, and then move those files again to another external hard drive 1T. My question is:

    I had a windows laptop, and I save files like photos,documents, videos and other things on an external hard drive, and now I want tomove those files to the Mac book Pro, and then move those files again toanother external hard drive 1T. My question is: Is it possible? Doing this willnot affect the files that I had in windows? No information is lost? or how cani do it?

    Connect the external drive to your Mac and drag the files from it to your Mac's internal drive. Then dismount and disconnect the external drive, connect the 1TB external drive, and drag the files from the internal drive onto the external. Nothing will have been deleted from any of the drives up to this point; the files will only have been copied. Verify that the files are readable. There's no reason they shouldn't be; this is just a precaution.
    Now if you wish to delete the files from any of the drives, drag them to the Trash, and Empty the Trash while the drive from which they came is still connected. If you disconnect the drive before emptying the Trash, the files you were trying to remove from it won't be deleted. They'll remain in the Trash and continue to take up space on the drive.
    Note that if your external drives are in NTFS format, you won't be able to write anything to them or delete anything from them, though you will be able to read and copy the files they contain. The NTFS disk format is read-only to the Mac OS, unless you have a third-party NTFS driver installed. To make your drives cross-platform readable and writable, you must reformat them in the FAT32 or ExFAT format.

  • Hello, i am new to the mac and i need to learn how to re image using an external hard drive

    Hello, i am new, like baby fresh new,...lol, to the mac and i need to learn how to re-image using an external hard drive.

    How to replace or upgrade a drive in a laptop
    Step One: Repair the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger, Leopard or Snow Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Step Two: Remove the old drive and install the new drive.  Place the old drive in an external USB enclosure.  You can buy one at OWC who is also a good vendor for drives.
    Step Three: Boot from the external drive.  Restart the computer and after the chime press and hold down the OPTION key until the boot manager appears.  Select the icon for the external drive then click on the downward pointing arrow button.
    Step Four: New Hard Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your new hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID  then click on the OK button. Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    Step Five: Clone the old drive to the new drive
    1. Open Disk Utility from the Utilities folder.
    2. Select the destination volume from the left side list.
    3. Click on the Restore tab in the DU main window.
    4. Check the box labeled Erase destination.
    5. Select the destination volume from the left side list and drag it to the Destination entry field.
    6. Select the source volume from the left side list and drag it to the Source entry field.
    7. Double-check you got it right, then click on the Restore button.
    Destination means the new internal drive. Source means the old external drive.
    Step Six: Open the Startup Disk preferences and select the new internal volume.  Click on the Restart button.  You should boot from the new drive.  Eject the external drive and disconnect it from the computer.

  • My Bluetooth disappeared from my MacBook. How do I reinstall? That was my question, I recommend intalar MAC OS X 10.5 Leopard, but would have to format the MAC to have bluetooth, but I ended up installing snow leopard and windows 20011. I'll install Windo

    My Bluetooth disappeared from my MacBook. How do I reinstall?
    That was my question, I recommend intalar MAC OS X 10.5 Leopard, but would have to format the MAC to have bluetooth, but I ended up installing snow leopard and windows 20011. I'll install Windows 2011 with the same key? Why does the snow leopard has not fixed the bluetooth?

    Download and install this update combo. This update combo for Snow Leopard can bring any version of Snow Leo up to 10.6.8 with the lastest version of App Store for Snow Leo.
    OS X Snow Leopard 10.6.8 v1.1 update combo
    http://support.apple.com/kb/DL1399

  • I am going to buy a mac mini i7 with 3 thunderbolt displays for forex trading. the question is if i use bootcamp and run windows on the mac mini will the displays still run the same way as if i was running it on Lion?

    I am going to buy a mac mini i7 with 3 thunderbolt displays for forex trading. the question is if i use bootcamp and run windows on the mac mini will the displays still run the same way as if i was running it on Lion?

    No idea if Windows will do it, but you can run Windows without Bootcamp & have OSX available at the same time, which should give you all the Monitors that OSX uses.
    Parallels...
    http://www.parallels.com/
    VmWare Fusion...
    http://www.vmware.com/mac

  • Question about the Mac Pro's Video Abilities

    Hi, I'm strongly considering buying a new Mac. I've looked at the iMacs, but I am more used to Tower PCs. The Mac Pro's design and expandability is what I am used to. My question I have is concerning the graphics ability of the Mac Pro. Currently, I have a HP vs17e LCD monitor and an old Envision EN910 CRT monitor. I am very pleased with both of these monitors. Recently, I hooked up the HP monitor to this old 400MHz G3 8MB Video iMac, and it looked really good except the text sometimes looked a little blurry. I figure that the 8MB video might have had something to do with that. I do not care that much about widescreen displays or high performance $700 displays. I like to use simple, old style monitors. Would I be able to use either one of these screens on the Mac Pro with a GeForce 7300 card? Also, my next question is concerning the use of a TV as a secondary display. Our TV is a big Toshiba that has the old style CRT format. It accepts the yellow video connector and another connector that I think is called the S-Video (black connector). Can I buy adapters that will allow me to use the TV as a second display?

    I would venture to say that if the monitor has a digital input capability, then the cable that would be used, is not like the output from the Mac. But, if you want to use the digital to analog adapter that comes with the Mac Pro, or is a purchased item for some of the lower priced Macs, the monitor will work as an analog VGA monitor. The gal that cuts my hair was telling me the horror story abount how they had to spend $200 to connect their Apple Cinema Display to their PC. I am pretty sure you won't have to spend that kind of money. So, if your monitor will accept an analog input, it should work. Many LCD monitors were only analog when they first came out years ago. I took a short look at yours. It appears to only have an analog input. My Mac Pro manual says to use the adapter if you want to hook up an analog VGA monitor. You can verify this at an Apple store before you purchase. I don't see any issues, but it is always best to "get it from the horses mouth".
    Michael

  • 0 down vote favorite        I would like to ask the following question. I am using mac os x 10.9 maverics me quicktime player version 10.3. Can I trim a video recording without having to press the pause or save it as a file? Or can I add a new recording t

    0 down vote  favorite  
    I would like to ask the following question. I am using mac os x 10.9 maverics me quicktime player version 10.3. Can I trim a video recording without having to press the pause or save it as a file? Or can I add a new recording to a video file? Thanks in advance

    Well,
    I tried the "Internet Recovery" option and finally saw Mac OS X Mountain Lion's install page but after waiting 7 hours when I just thought its going to start installing, I got another progress bar with 36 hours remining time to download "Additional Components" then after progressing 2-3 hours, it shows "Unable to write installation something..., Contact Apple Care"
    Then I accidently rebooted the machine and now it seems Internet Recovery don't work anymore, it shows "support.apple.com - 40 something!" error, and finally when I tried to reboot using Recovery HD, I found it's gone as-well!
    To be honest, I don't know what to do now, I am and dissapointed... also I do not have any Apple Store nearby, there is an authorized country reseller almost 650/km far away from my residents and they even charges too high (like $250) for doing such repairs (as per phone conversation)
    If anyone have any idea or anything to help me with, please do share- I'd be eternally grateful!

  • Accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    I'm going to assume that since you deleted your hard drive and all its files, you had a backup, yes? If the backup has an OS (bootable clone), then you can boot into it by holding down the option key when you start up you iMac and choose the backup drive. Then use Carbon Copy Cloner or Super Duper to copy the files back to your iMac.

  • What is the best manual to help me learn Mountain Lion and the Mac?

    What is the best manual to help me learn Mountain Lion and the Mac?

    The internet is your friend.   http://www.apple.com/support/macbasics/, http://www.tuaw.com/tag/mountain%20lion%20101/

Maybe you are looking for

  • I found more features for iWeb

    Here's just some of the things I've been able to do thanks to many on this forum as well as a little research of my own. All of these features are available on my website, http://www.iWebTricks.com and I even show you how you can do it on your own iW

  • Are BT actually taking any new orders for the old ...

    I was talking to someone on another forum who said he thinks that Vision will be phased out and people moved over to youview. I asked him why he thinks that and he said that when he tried to order, the only option he was given was a youview box. So I

  • N73 and PC Suite

    Dear Nokia The screen on my laptop does not work when it has both PC Suite and Norton. I works when either is on separately but not together. If I load PC Suite on another PC will this same thing happen? Peter

  • Configuration of weekly holiday

    Hi All I am working on negative time management configuration. Company has different weekly holiday/s for their different location. There are holidays on Saturday and Sunday for location A, but only Sunday is the holiday for location B. I want to mak

  • Set directory path

    I have to call native applications from within my java application (using the Runtime.getRuntime().exec() method). That works fine but I need to change the current directory path to a specific path. How it is done to change the current directory path