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

来源:互联网 发布:网络交友诈骗案例 编辑:程序博客网 时间:2024/05/16 05:40

你可以把这篇文章作为你开始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 0
原创粉丝点击