Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
guygodin's avatar
guygodin
Protege
11 years ago

SDK 0.3.1 and compiling LibOVR to DLL

So I've been able to tweak the LibOVR project so that it compiles to a DLL rather than a static library. To do this I've added the following dependencies in Linker->Input->Additional Dependencies:

    msvcrt.lib (msvcrtd.lib for debug)
    winmm.lib
    setupapi.lib


I've also changed the Target Name to be libovr for both Win32 and x64 platforms. The reason I'm doing this is to be able to P/Invoke LibOVR from C# and I want it to work with AnyCPU (I'm loading the appropriate Win32/x64 library manually). I'm developing a .NET wrapper (which I intend to release as a NuGet package) and wanted to use the new C API rather than wrap the C++ classes in CLI/C++ like RiftDotNet does so that its easier to maintain.

So far so good but I was wondering if there were any plans to release LibOVR as a DLL rather than a static lib in the future? (I'm not a big fan of changing project properties, and I think it goes against the terms and conditions of the license).

I also had to change the OVR_EXPORT definition as it did not export with x64


#if defined(WIN32)
#define OVR_EXPORT __declspec(dllexport)
#else
#define OVR_EXPORT // Before
#define OVR_EXPORT __declspec(dllexport) // After
#endif


Thanks!
Guy

14 Replies