title: Exposing C function from custom Objective-C Framework
body: <p>I'm attempting to write my first custom Cocoa Framework and I want to expose a simple C function from the framework that wraps up a bunch of functionality, much like NSApplicationMain does. When I simply imported the files directly from within the project, everything went fine, the project built and my C function was called correctly.</p>
  
  <p>Now I have a new Cocoa Framework project which contains the files, I cant build my program because I get "Symbols not found" error messages, specifically for my C function.</p>
  
  <p>I've tried prefixing the function definition in the header file with extern, but still nothing.</p>
  
  <p>Can anyone give me a heads up? How can I expose standard C functions via custom Cocoa Framework?</p>
  
  <p>Rough idea of what I'm doing:</p>
  
  <p>My Program that uses my custom framework:</p>
  
  <pre><code>#import &lt;BDWebApplicationFramework/BDWebApplication.h&gt;
  
  int main (int argc, const char * argv[]) {
      return BDWebApplicationMain(argc, (const char **)argv);
  }
  </code></pre>
  
  <p>My framework header: BDWebApplication.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface BDWebApplication : NSObject {
      NSString *name;
  }
  @property (readwrite, copy) NSString *name;
  
  @end
  
  extern int BDWebApplicationMain(int argc, const char * argv[]);
  </code></pre>
  
  <p>My framework file: BDWebApplication.m</p>
  
  <pre><code>#import "BDWebApplication.h"
  
  @implementation BDWebApplication
  
  @synthesize name;
  
  - (id)init
  {
      [super init];
      name = @"New name";
      return self;
  }
  
  - (void)dealloc
  {
      [name release];
      [super dealloc];
  }
  
  @end
  
  int BDWebApplicationMain(int argc, const char * argv[])
  {
     // Do some Obj-c stuff here
  }
  </code></pre>