Leap_NoPi.h cannot open include file Leap.h

Hello,

I have created a cpp file from the LeapController, but I have not added any code to that file yet, but the engine is giving me this error: Leap_NoPi.h cannot open include file Leap.h, even though I have the Include folder, with leap.h file inside of that folder, in the include directory of the project.

Does anyone know how to solve this?

Thanks in advance.

Hi Rama,

I was having the same problem, but found a really hacky workaround to it.
So you can find Leap.h in “UE4_install_folder/Engine/Plugins/LeapMotion/ThirdParty/LeapSDK/Include/” and you can add this include path to your module build rules like such

 PrivateIncludePaths.AddRange(new string[] { "UE4_install_folder/Engine/Plugins/Runtime/LeapMotion/ThirdParty/LeapSDK/Include/" });

after that it compiles just fine.

I haven’t had the chance to test if it actually works, but I already know the “Blueprint method” (aka. implementing ILeapEventInterface, and adding LeapController component) probably doesn’t work, because all events in ILeapEventInterface are declared as BlueprintImplementableEvent (so they supposedly can’t have a Blueprint definition).

If you have a workaround for that one I’m all ears/eyes. In the meantime I made a post about this problem.
Hope one of us will find a way, and post it here :slight_smile:

I hope I was of some help.

Mind that this only let’s you access the same functionality as in Blueprints. if you want everything that is in the LeapMotion SDK you need to specify some more stuff, like loading the appropriate .lib/.dll files.

I haven’t experimented with that yet, but UE4_install_folder\Engine\Plugins\Runtime\LeapMotion\Source\LeapMotion\LeapMotion.Build.cs seems like a good starting point / reference.

Oh, yeah, and here’s the post I made about a workaround : HERE