Forum Discussion
ckoeber
11 years agoHonored Guest
[SOLVED] Enabling 64-bit Support for Oculus Rift SDK
Hello,
I apologize in advance for asking what is most likely a trivial question, but I am not finding the answer to this question in the documentation or via searching (Google or Forums).
How do I enable 64-bit programming support using the Oculus Rift SDK?
I changed my VC++ 2013 project to use 64-bit code and included the libraries for 64-bit code (libovr64lib and libovr64d.lib) but the compile fails with:
"Error 5 error LNK1104: cannot open file 'libovrd.lib'"
So it seems it is still looking for the 32-bit version of the libraries.
Is there a 64-bit directive I need to put at the top of my project somewhere?
Thank you for your time.
I apologize in advance for asking what is most likely a trivial question, but I am not finding the answer to this question in the documentation or via searching (Google or Forums).
How do I enable 64-bit programming support using the Oculus Rift SDK?
I changed my VC++ 2013 project to use 64-bit code and included the libraries for 64-bit code (libovr64lib and libovr64d.lib) but the compile fails with:
"Error 5 error LNK1104: cannot open file 'libovrd.lib'"
So it seems it is still looking for the 32-bit version of the libraries.
Is there a 64-bit directive I need to put at the top of my project somewhere?
Thank you for your time.
8 Replies
- jhericoAdventurerI've created a Github version of the SDK that uses CMake to generate project files, rather than relying on the SDK project files. Building the OVR code in 64 bit mode is as easy as telling CMake to target "Visual Studio 12 Win64". It generates the solution, which I can then open in Visual Studio and build.
The main repository is here: https://github.com/jherico/OculusSDK
The 0.3.1 preview release is on this branch: https://github.com/jherico/OculusSDK/tree/preview_031_dll - ckoeberHonored GuestThank you so much for this; I assume you build completely in 64-bit and then reference this GitHubbed 64-bit Oculus SDK code in your existing VC++ 2013 projects?
Thanks again. - jhericoAdventurer
"ckoeber" wrote:
Thank you so much for this; I assume you build completely in 64-bit and then reference this GitHubbed 64-bit Oculus SDK code in your existing VC++ 2013 projects?
Thanks again.
Sort of. I no longer use Visual Studio or any IDE for setting up C++ projects if I can possibly avoid it.
Instead I use CMake to generate projects. So for instance, the set of example applications I have on Github in another repository includes my Github copy of the SDK as a Git submodule. The CMake file for the example applications in turn references the CMake file for the Oculus SDK. So when I tell CMake to generate project files it creates an entire solution with both the example applications and the Oculus SDK. Of course if you just want to build the SDK as a DLL and put the header somewhere, you can do that as well. "ckoeber" wrote:
Hello,
I apologize in advance for asking what is most likely a trivial question, but I am not finding the answer to this question in the documentation or via searching (Google or Forums).
How do I enable 64-bit programming support using the Oculus Rift SDK?
I changed my VC++ 2013 project to use 64-bit code and included the libraries for 64-bit code (libovr64lib and libovr64d.lib) but the compile fails with:
"Error 5 error LNK1104: cannot open file 'libovrd.lib'"
So it seems it is still looking for the 32-bit version of the libraries.
Is there a 64-bit directive I need to put at the top of my project somewhere?
Thank you for your time.
How did you include the libraries for 64 bit? Do you mean you added libovr64.lib to the Linker / Input / Additional Dependencies field of the project properties?
If you open up the samples solution and change the solution platform to x64 (it's a combobox just under the menu bar, would say win32 by default) then you can see all the settings the samples use to build in 64 bit. (mainly just adding libovr64 to the additional dependencies and setting Linker / Advanced / Target Machine to Machinex64)- ckoeberHonored GuestThank you for all of your help. The referenced project built without issue.
In my project when I had it as 32-bit I had a linker dependency on libovrd.lib
Has that been superseded by OVR_C.lib or OculusVR.lib?
I am not sure which libraries I should include as dependencies.
New here :) - ckoeberHonored Guest
"kojack" wrote:
How did you include the libraries for 64 bit? Do you mean you added libovr64.lib to the Linker / Input / Additional Dependencies field of the project properties?
If you open up the samples solution and change the solution platform to x64 (it's a combobox just under the menu bar, would say win32 by default) then you can see all the settings the samples use to build in 64 bit. (mainly just adding libovr64 to the additional dependencies and setting Linker / Advanced / Target Machine to Machinex64)
I didn't even see your reply :)
I got pass the library part but I am getting additional errors which I will post shortly - ckoeberHonored GuestSo, first I want to say thank you for all of the help thus far.
I believe I have all of the libraries loaded but now I get a bunch of errors which seems to be related to built-in functions, tec.
This is what I am getting. Do I have a messed up dependency somewhere?
Thank you.
Error 5 error LNK2005: memmove already defined in LIBCMTD.lib(memcpy.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 6 error LNK2005: strcpy_s already defined in LIBCMTD.lib(strcpy_s.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 7 error LNK2005: strcat_s already defined in LIBCMTD.lib(strcat_s.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 8 error LNK2005: __iob_func already defined in LIBCMTD.lib(_file.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 9 error LNK2005: _malloc_dbg already defined in LIBCMTD.lib(dbgheap.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 10 error LNK2005: _realloc_dbg already defined in LIBCMTD.lib(dbgheap.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 11 error LNK2005: _free_dbg already defined in LIBCMTD.lib(dbgheap.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 12 error LNK2005: strtod already defined in LIBCMTD.lib(strtod.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 13 error LNK2005: wcscat_s already defined in LIBCMTD.lib(wcscat_s.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 14 error LNK2005: wcscmp already defined in LIBCMTD.lib(wcscmp.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 15 error LNK2005: wcscpy_s already defined in LIBCMTD.lib(wcscpy_s.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 16 error LNK2005: wcslen already defined in LIBCMTD.lib(wcslen.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 17 error LNK2005: wcsncpy_s already defined in LIBCMTD.lib(wcsncpy_s.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 18 error LNK2005: _wcsicmp already defined in LIBCMTD.lib(wcsicmp.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 19 error LNK2005: localeconv already defined in LIBCMTD.lib(lconv.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 20 error LNK2005: "private: __cdecl type_info::type_info(class type_info const &)" (??0type_info@@AEAA@AEBV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(ti_inst.obj) CustomProject
Error 21 error LNK2005: "private: class type_info & __cdecl type_info::operator=(class type_info const &)" (??4type_info@@AEAAAEAV0@AEBV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(ti_inst.obj) CustomProject
Error 22 error LNK2005: _vsnprintf_s already defined in LIBCMTD.lib(vsnprnc.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Error 23 error LNK2005: _CrtDumpMemoryLeaks already defined in LIBCMTD.lib(dbgheap.obj) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MSVCRTD.lib(MSVCR120D.dll) CustomProject
Warning 24 warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\LINK CustomProject
Error 25 error LNK2001: unresolved external symbol IID_ID3D11ShaderReflection E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MainDirectXRenderer.obj CustomProject
Error 26 error LNK2019: unresolved external symbol "int __cdecl MELF::UtilityFunctions::Init(void)" (?Init@UtilityFunctions@MELF@@YAHXZ) referenced in function "int __cdecl MELF::UtilityFunctions::WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@UtilityFunctions@MELF@@YAHPEAUHINSTANCE__@@0PEADH@Z) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MainProgram.obj CustomProject
Error 27 error LNK2019: unresolved external symbol "void __cdecl MELF::UtilityFunctions::ProcessAndRender(void)" (?ProcessAndRender@UtilityFunctions@MELF@@YAXXZ) referenced in function "int __cdecl MELF::UtilityFunctions::WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@UtilityFunctions@MELF@@YAHPEAUHINSTANCE__@@0PEADH@Z) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MainProgram.obj CustomProject
Error 28 error LNK2019: unresolved external symbol "void __cdecl MELF::UtilityFunctions::Release(void)" (?Release@UtilityFunctions@MELF@@YAXXZ) referenced in function "int __cdecl MELF::UtilityFunctions::WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@UtilityFunctions@MELF@@YAHPEAUHINSTANCE__@@0PEADH@Z) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MainProgram.obj CustomProject
Error 29 error LNK2019: unresolved external symbol "void __cdecl MELF::UtilityFunctions::DistortionMeshRelease(void)" (?DistortionMeshRelease@UtilityFunctions@MELF@@YAXXZ) referenced in function "void __cdecl MELF::UtilityFunctions::ReleaseWindowAndGraphics(class MELF::Rendering::RenderDevice *)" (?ReleaseWindowAndGraphics@UtilityFunctions@MELF@@YAXPEAVRenderDevice@Rendering@2@@Z) E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\MainProgram.obj CustomProject
Error 30 error LNK2019: unresolved external symbol "public: static class OVR::Platform::Application * __cdecl OVR::Platform::Application::CreateApplication(void)" (?CreateApplication@Application@Platform@OVR@@SAPEAV123@XZ) referenced in function WinMain E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\CommonSrc.lib(Win32_Platform.obj) CustomProject
Error 31 error LNK2019: unresolved external symbol "public: static void __cdecl OVR::Platform::Application::DestroyApplication(class OVR::Platform::Application *)" (?DestroyApplication@Application@Platform@OVR@@SAXPEAV123@@Z) referenced in function WinMain E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\CommonSrc.lib(Win32_Platform.obj) CustomProject
Error 32 error LNK1120: 7 unresolved externals E:\Oculus Rift\OculusSDK31\Samples\CustomProject\CustomProject\x64\Debug\CustomProject.exe CustomProject - ckoeberHonored Guest
"kojack" wrote:
How did you include the libraries for 64 bit? Do you mean you added libovr64.lib to the Linker / Input / Additional Dependencies field of the project properties?
If you open up the samples solution and change the solution platform to x64 (it's a combobox just under the menu bar, would say win32 by default) then you can see all the settings the samples use to build in 64 bit. (mainly just adding libovr64 to the additional dependencies and setting Linker / Advanced / Target Machine to Machinex64)
Turns out you were right; redownloaded the base package; changed to x64 bit, and then carefully compared my project to the other projects did the trick.
Thank you for your time.
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
- 10 months ago
- 3 years ago