在VS上创建一个leapmotion的c++程序

你可以把这篇文章作为你开始leapmotion开发的起点。如果你创建64位的应用,使用lib\x64,32位应用使用lib\x86.

  1. Open or create a new project of the desired type.
  2. Make a LEAP_SDK system environment variable to point to your Leap Motion SDK folder. This step is optional, but does simplify creating references to the SDK files in your projects. (As a reminder, you can create and change system environment variables from the Windows System Properties dialog.)
  3. Open the Project Property Pages using the Project > Properties menu command.
  4. Set up a Debug configuration:
  1. Choose the Debug configuration.
  2. Add the SDK include directory to your project:
  1. Under Configuration Properties, select C/C++ > General.

  2. In the properties pane, add the SDK include directory to the Additional Include Directoriesfield by adding:

    $(LEAP_SDK)\include
    
(where  LEAP_SDK is the name of the environment variable you created earlier. You can substitute the appropriate file path if you do not want to use an environment variable.)
  1. Add references to the Leap Motion libraries:
  1. Under Configuration Properties, select Linker > General.

  2. In the properties pane, add the SDK lib\x86 directory (or lib\x64 for 64-bit configurations) to the Additional Library Directories field by adding:

    $(LEAP_SDK)\lib\x86
    
  3. Select Linker > Input

  4. Add Leap.lib to the Additional Dependencies field.

  1. Add a Post-Build Event to copy the Leap Motion libraries to the project’s target executable directory.
  1. Under Configuration Properties, select Build Events > Post-Build Event.

  2. Edit the Command Line field to copy the libraries, adding:

    xcopy /yr "$(LEAP_SDK)\lib\x86\Leap.dll" "$(TargetDir)"
    
  1. Set up a Release configuration:
  1. Choose the Release configuration.
  2. Repeat the setps above.
  1. Add your source code...

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值