Skip to main content
New Participant
April 13, 2013

Build error on Windows 8 VC++ 2010 Express

Hi,

I downloaded the Oculus SDK, unpacked it and opened LibOVR_With_Samples_Msvc2010.sln in VC++ 2010 (Express edition). While building the solution I am getting the following error during the build of OculusWorldDemo.

e:\downloads\oculussdk\samples\commonsrc\render\Render_D3D1X_Device.cpp(29): fatal error C1083: Cannot open include file: 'd3dcompiler.h': No such file or directory


LibOVR was built successfully.

I looked around the web and found this http://www.gamedev.net/topic/631381-error-lnk2019-with-d3dcompilerh/#entry4980801. I'm not sure how their proposed solution can be applied for the Oculus SDK.

Any suggestions?
Thanks.

    12 replies

    kojack
    Honored Contributor
    April 14, 2013
    Microsoft removed dynamic shader compiling (d3dcompiler.h) from the windows 8 platform sdk. There's other stuff they nerfed too, like direct input and d3dx. You'll need to install the june 2010 (that's the latest) directx sdk.
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3
    jayeshAuthor
    New Participant
    April 14, 2013
    Thanks kojack. That did the trick.

    I learnt that on Windows 8, DirectX SDK has been made part of Windows SDK. I installed it from here http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx

    After that I had to configure the properties of each project (OculusWorldDemo, OculusRoomTiny, SensorBoxTest) so that it could find the header files, library files and dll files.

    I installed the SDK under E:\Windows Kit. Accordingly I had to update the paths as follows:

    VC++ Directories:
    Include Directories = E:\Windows Kits\8.0\Include\um;E:\Windows Kits\8.0\Include\shared;$(IncludePath)
    Library Directories = E:\Windows Kits\8.0\Lib\win8\um\x86;$(LibraryPath)


    This should get your projects building successfully. However you will get DLL not found error if you start debugging. For that you need to change the Debugging->Environment in the project properties as well. I set it to:

    PATH=%PATH%;E:\Windows Kits\8.0\bin\x86$(LocalDebuggerEnvironment)


    After all this I could run each of the demos. However OculusWorldDemo crashed just a moment after starting. OculusRoomTiny ran successfully with an obvious warning of the device not found (I haven't received my hardware yet). SensorBoxTest ran ok and showed me the axes (but did nothing, probably because that needs the device too).

    Hope this helps.
    New Participant
    June 2, 2013
    I have the same problem but I'm running it form Windows 7 pro 32 do I have to do the same thing? where can I find the d3dcompiler.h ?
    Up and Coming
    June 2, 2013
    "BorealProject" wrote:
    I have the same problem but I'm running it form Windows 7 pro 32 do I have to do the same thing? where can I find the d3dcompiler.h ?

    You can get d3dcompiler.h from either the new DirectX SDK (which comes with the new Windows SDK), or the old DirectX SDK (which comes as a standalone download). By default, the old SDK installs all of the include files to this directory:
    Program Files\Microsoft DirectX SDK (June 2010)\Include
    whereas the new SDK places the include files inside the Windows SDK directory, which you select during the installer process :)
    kojack
    Honored Contributor
    June 2, 2013
    Oops, I was half wrong above. They did include d3dcompiler.h in the win 8 platform sdk (in the include/um directory). But d3dx is definitely removed.

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275%28v=vs.85%29.aspx
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3
    September 6, 2013
    Hi, having issues getting the Samples to compile - LibOVR_With_Samples_Msvc2010

    I've downloaded and installed the Windows Software Development Kit (SDK) for Windows 8

    http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx

    The directories all need fixing to the new SDK location. (you don't need the (x86) in the file path
    http://blogs.msdn.com/b/vcblog/archive/2012/03/25/10287354.aspx

    In fact just update the
    Project Properties > C/C++ > Additional Includes Directory
    $(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\um;../../LibOVR/Include;../../LibOVR/Src;../../3rdParty/glext;$(DXSDK_DIR)/Include;%(AdditionalIncludeDirectories)

    Next compilation error is:
    1>------ Build started: Project: OculusRoomTiny, Configuration: Debug Win32 ------
    1> OculusRoomModel.cpp
    1> RenderTiny_D3D1X_Device.cpp
    1> RenderTiny_Device.cpp
    1> Win32_OculusRoomTiny.cpp
    1>LINK : fatal error LNK1104: cannot open file 'd3dcompiler.lib'
    ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========


    Any suggestions?

    Wait found the issue:

    Project Properties > Linker > General > Additional Directories:
    $(ProgramFiles)\Windows Kits\8.0\Lib\win8\um\x86;../../LibOVR/Lib/Win32;$(DXSDK_DIR)/Lib/x86;%(AdditionalLibraryDirectories)


    2> OculusRoomTiny_Msvc2010.vcxproj -> C:\VR\OculusSDK\Samples\OculusRoomTiny\Debug\OculusRoomTiny.exe
    ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

    Hope this helps you Bros

    Wait there is more

    ---------------------------
    Microsoft Visual C++ 2010 Express
    ---------------------------
    Unable to start program 'C:\VR\OculusSDK\LibOVR\Projects\Win32\../../Lib/Win32/libovrd.lib'.
    ---------------------------
    OK
    ---------------------------
    September 6, 2013
    If you get the following - set the Solution Properties for LibOVR_With_Samples_Msvc2010 to Single Startup Project
    OculusRoomTiny

    ---------------------------
    Microsoft Visual C++ 2010 Express
    ---------------------------
    Unable to start program 'C:\VR\OculusSDK\LibOVR\Projects\Win32\../../Lib/Win32/libovrd.lib'.

    The specified file is an unrecognized or unsupported binary format.
    ---------------------------
    OK
    ---------------------------
    September 6, 2013
    ---------------------------
    OculusRoomTiny.exe - System Error
    ---------------------------
    The program can't start because D3DCOMPILER_46.dll is missing from your computer. Try reinstalling the program to fix this problem.
    ---------------------------
    OK
    ---------------------------


    Next with Windows 8.0 SDK you need to now include D3DCOMPILER_46.dll as part of the build.

    Find it here: Windows Kits\8.0\Redist\D3D

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/35ffa6d9-3f97-4ae5-a7f1-3f915c37fda2/dx-development-in-win8-with-win8-sdk
    http://blogs.msdn.com/b/chuckw/archive/2012/05/07/hlsl-fxc-and-d3dcompile.aspx


    Haven't quite worked out how to add the dll to the build files yet. (Crash course on C++ dev...)


    Ok got it... copy the following dlls into the OculusSDK\Samples\OculusRoomTiny folder

    d3dcompiler_46.dll
    d3dcsx_46.dll

    Build it and run.
    New Participant
    April 15, 2014
    @nzearthman

    Thanks for your help. I tried everything you posted here, but I still can't get any of the sample projects to run. They all compile now, but I get the same error you had earlier:

    ---------------------------
    Microsoft Visual C++ 2010 Express
    ---------------------------
    Unable to start program 'C:\VR\OculusSDK\LibOVR\Projects\Win32\../../Lib/Win32/libovrd.lib'.

    The specified file is an unrecognized or unsupported binary format.
    ---------------------------
    OK
    ---------------------------

    I set the project solution property to 'Single Startup Project', but that didn't change anything. I'm using Windows 7 x64 and VS 2010 Ultimate; I also tried it with VS2012 Ultimate and VS2013 Ultimate, same error everywhere. It appears for all samples, and for both Release and Debug configurations (means both files libovr.lib and libovrd.lib lead to the error).

    Any suggestions?

    Thanks in advance everyone.

    Yeehaw
    kojack
    Honored Contributor
    April 15, 2014
    In the solution explorer the libovr library must not be in bold. The error is saying you are trying to run the library itself (which is impossible) instead of one of the demos.



    Right click on the roomtiny or world demo and select Set As Startup Project.
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3