Search code examples
xcodexcode4xcode4.2

Issue with compiling example code


I'm trying to compile this sample code with XCode 4.2b, here's how my project looks like:

enter image description here

Application type: Command Line Tool. When I'm trying to build the project, I get the following list of errors:enter image description here

I suppose that I haven't added some frameworks to the project, though I don't know what frameworks should be added...


Solution

  • The imported files probably contain Objective C code, but you're using the C compiler.

    Change the file extension of main.c to main.m.