Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Hassmann's avatar
Hassmann
Honored Guest
12 years ago

Use LibOVR with managed c++/cli (VS2012)

Hello colleagues,

I am trying to access the Rift from C# and have written a CLR wrapper with C++/CLI.

Unfortunately, the wrapper assembly will not load into a C# assembly. Runtime error:

"Could not load file or assembly 'Oculus.dll' or one of its dependencies. The specified module could not be found."

The OculusRoomTiny sample in the same solution builds and runs fine, I have copied all include settings to my wrapper.
In my configuration I have set the platform for all projects to x86/WIN32 or x64, respectively. To no avail.

It has been some 7 years since I have programmed in C++, so a lot will have slipped my mind.
Could you please help me with this?

Thanks,

Andreas Hassmann.

3 Replies

  • When you build your Oculus.dll make sure you include winmm.lib.
  • thanks for pointing in the library direction, jcollins.

    winmm.lib was included, but due to the different approach to resolving dll hell in .NET
    it turned out that you must

    have a copy of the right version (platform) of d3dcompiler_xx.dll present in the executing assembly directory.

    In my case that was

    d3dcompiler_46.dll (VS2012)

    and is probably

    d3dcompiler_47.dll (VS2013)
  • Or, if you are the rather clever type of .NET developer, you just use

    the SharpOVR package by Guy Godin

    which is easily included via NuGet.


    I will just delete my feeble C++ attempts...