Forum Discussion
Hassmann
12 years agoHonored Guest
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.
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
- tozz3rExplorerWhen you build your Oculus.dll make sure you include winmm.lib.
- HassmannHonored Guestthanks 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) - HassmannHonored GuestOr, 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...
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 months ago