Amazon.com Widgets main.c or main.m?
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 19, 2014, 12:51:29 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Help!!!
| | |-+ main.c or main.m?
Pages: [1] Go Down
Print
Author Topic: main.c or main.m? (Read 1243 times)
manfromsun
Newbie
*
Posts: 3






on: August 22, 2011, 07:51:01 PM

Hello,

I created a New Project, following the book instructions. 
However this created main.c but not main.m, which is described in the book.
Now, when I try to import the Foundation.h into it, the build fails.
Any suggestions?


//
//  main.c
//  prog1
//

//

#include <CoreFoundation/CoreFoundation.h>

int main (int argc, const char * argv[])
{

    // insert code here...
    CFShow(CFSTR("Hello, World!\n"));
    return 0;
}
Logged
dharr19
Full Member
***
Posts: 175


Email




Reply #1 on: August 22, 2011, 08:31:29 PM

hi,

Looks like a C++ program.  When you start a new project choose Command Line Tool then click next and choose Foundation as the type of program from the drop down. 

Hope this helps
David
Logged
manfromsun
Newbie
*
Posts: 3






Reply #2 on: August 22, 2011, 08:49:33 PM

Thanks a lot, David! Initially I selected Core Foundation, which was the default option. Once changed it to <Foundation>, the proper files were created.
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.