Thread: C Code in Xcode

  1. #1
    Registered User
    Join Date
    Apr 2011
    Location
    Perth Western Australia
    Posts
    1

    C Code in Xcode

    I have successfully implemented C Code in Apple Xcode IDE, and have created a basic View to display the Results text file which is created by the C Code...
    How ever, I do need some help now...
    The issue:

    Both my C code, and Cocoa code begin by pointing to main()...
    These are in conflict.
    I can get the C code and Cocoa Code to compile and run OK, provided I comment out the other.

    So, how do I integrate my C code into the Xcode environment, and create links to Views, for data entry, and for output presentation?

    I have been browsing a manuals, documents, and tutorials on Xcode, but so far have not been able to sort out what I thought would be a relatively simple issue...

    Thanks...

    Code:
    int main()                                  /* the beginning of my C code */
    
    int main(int argc, char *argv[])    /* the beginning of the Xcode main.m */
    Last edited by rmcinnes; 04-11-2011 at 07:14 AM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I'm sure some here will help you but I'm thinking you'll probably get better answers in an XCode forum.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Well you can't have two mains for one thing! One main per executable. You need to create libraries which are then used by the Cocoa application. See here

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 03-09-2011, 06:38 AM
  2. getline under Xcode on a Mac
    By Dino in forum C++ Programming
    Replies: 7
    Last Post: 12-26-2009, 11:37 AM
  3. Need help from you Xcode users
    By Memloop in forum Tech Board
    Replies: 7
    Last Post: 09-22-2009, 10:27 AM
  4. XCode and files
    By Fox101 in forum C Programming
    Replies: 7
    Last Post: 12-13-2007, 03:07 PM
  5. mac os x xcode
    By magus2500x in forum C++ Programming
    Replies: 2
    Last Post: 11-03-2005, 12:12 AM

Tags for this Thread