你可以把这篇文章作为你开始leapmotion开发的起点。如果你创建64位的应用,使用lib\x64,32位应用使用lib\x86.
- Open or create a new project of the desired type.
- 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.)
- Open the Project Property Pages using the Project > Properties menu command.
- Set up a Debug configuration:
- Choose the Debug configuration.
- Add the SDK include directory to your project:
Under Configuration Properties, select C/C++ > General.
In the properties pane, add the SDK include directory to the Additional Include Directoriesfield by adding:
(whereLEAP_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.)
- Add references to the Leap Motion libraries:
Under Configuration Properties, select Linker > General.
In the properties pane, add the SDK
lib\x86
directory (orlib\x64
for 64-bit configurations) to the Additional Library Directories field by adding:Select Linker > Input
Add
Leap.lib
to the Additional Dependencies field.
- Add a Post-Build Event to copy the Leap Motion libraries to the project’s target executable directory.
Under Configuration Properties, select Build Events > Post-Build Event.
Edit the Command Line field to copy the libraries, adding:
- Set up a Release configuration:
- Choose the Release configuration.
- Repeat the setps above.
- Add your source code...