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.) - How to make this environment variable?
I don't have a copy of Windows 7 handy so I suggest you do a little homework. It should be easily findable on the Internet. Or just skip it for now -- which means you have to replace $(LEAP_SDK) with the actual path in the steps below.
In the properties pane, add the SDK include directory to the
Additional Include Directories field by adding:
$(LEAP_SDK)\include - Does this mean you browse the folders and accept include -folder in here? Or just add this suggested thing?
The $(LEAP_SDK)
part is the environment variable you created earlier. You can also browse directly to the folder.
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 - Again, does this mean you brose the the folders and accept lib\x86 -folder in here or just add what is suggested?
Same as above.
Select Linker > Input
Add Leapd.lib to the Additional Dependencies field. - Just add this? Not the folder where it is?
The folder is specified in the Additional Library Directories
entry you just created.
Edit the Command Line field to copy the libraries, adding:
xcopy $(LEAP_SDK)\lib\x86\Leapd.dll "$(TargetDir)"
xcopy $(LEAP_SDK)\lib\x86\msvcp100d.dll "$(TargetDir)"
xcopy $(LEAP_SDK)\lib\x86\msvcr100d.dll "$(TargetDir)"
The msvcp100d.dll and msvcr100d.dll libraries are only needed for debugging configurations. For release configurations, copy only Leap.dll. - Again, just like this, copy and paste? If I release (I think means doing a final .exe) two last can be removed?
Yes, but copy/paste requires the environment variable defined earlier. These steps can also be done manually. They copy the libraries to the folder containing your .exe. For a release configuration, do not include the last two libraries.
Add a Post-Build Event to copy Leap.dll to the target executable directory. - And this last was tricky.
It is the same procedure as above for your debug configuration.
Note that I've only tested this on a few of the many versions of Visual Studio in use. But the steps are essentially the same as those you would use with any code library:
- Reference the header files
- Set the linking dependencies
- Put the .dlls in the right place so they can be found at runtime