which XCode tool to use?

Discussion in 'Mac Programming' started by myjay610, Dec 8, 2008.

  1. myjay610 macrumors regular

    Joined:
    Jan 6, 2008
    #1
    Hi all,

    I've spent years programming in C/C++ but using Visual Studio or just gcc via command line. Now I have a need to use some of the APIs included with OS X. Do I need to pick a particular tool for this?

    I first tried the C++ tool and I only need to use the Security/Security.h library for some keychain APIs. I try calling a simple function like SecKeychainGetVersion and I get collect2: ld returned 1 exit status, symbol(s) not found, "_SecKeychainGetVersion",referenced from:

    I've included the header file as needed so I really don't know what's going on.

    Thanks!
    John
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Did you include the framework too?
     
  3. myjay610 thread starter macrumors regular

    Joined:
    Jan 6, 2008
    #3
    I've included CoreFoundation, Security, and CoreServices. I saw those included on a sample program I found somewhere.
    John
     
  4. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #4
    You have to actually add the framework to the project to link against it, not just include the header files.

    Just right-click on the Frameworks and Libraries group in the project window and select Add -> Existing Frameworks... and go to the System -> Library -> Frameworks folder and select the Security.framework and the other frameworks you included the headers for.

    Then build and run it again.
     
  5. myjay610 thread starter macrumors regular

    Joined:
    Jan 6, 2008
    #5
    Perfect, works now! Thanks!
    John
     

Share This Page