Frameworks Xcode 5.0.2中的链接框架

Frameworks Xcode 5.0.2中的链接框架,frameworks,compilation,linker,xcode5,keyboard-events,Frameworks,Compilation,Linker,Xcode5,Keyboard Events,我试图在Xcode 5.0.2中的程序中添加现有的应用程序服务框架,但是,在终端中执行“make”进行编译时出现以下错误 Undefined symbols for architecture x86_64: "_CGEventCreateKeyboardEvent", referenced from: _main in main-gNfV8b.o "_CGEventPost", referenced from: _main in main-gNfV8b.o ld:

我试图在Xcode 5.0.2中的程序中添加现有的应用程序服务框架,但是,在终端中执行“make”进行编译时出现以下错误

Undefined symbols for architecture x86_64:
  "_CGEventCreateKeyboardEvent", referenced from:
      _main in main-gNfV8b.o
  "_CGEventPost", referenced from:
      _main in main-gNfV8b.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [main] Error 1
我使用“添加文件”将应用程序框架添加到我的项目中,并且包含了正确的头文件。我做错了什么

以下是我的代码的重要片段:

#include <stdio.h>
#include <ApplicationServices/ApplicationServices.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, const char* argv[])
{
     CGEventRef plus_on, plus_off;

     plus_on = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)31, true);
     plus_off = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)31, false);

     CGEventPost(kCGHIDEventTap, plus_on);

     CGEventPost(kCGHIDEventTap, plus_off);

     return 0;
}
#包括
#包括
#包括
#包括
#包括
int main(int argc,const char*argv[]
{
CGEventRef加_打开,加_关闭;
plus_on=CGEventCreateKeyboardEvent(NULL,(CGKeyCode)31,true);
plus_off=CGEventCreateKeyboardEvent(NULL,(CGKeyCode)31,false);
CGEventPost(kCGHIDEventTap,加上on);
CGEventPost(kCGHIDEventTap,加上关闭);
返回0;
}

更新-我仍然在终端中链接/编译时遇到问题,但它在Xcode中成功运行。不知道为什么。

更新-我仍然在终端中链接/编译时遇到问题,但它在Xcode中成功运行。不知道为什么