D3D11CreateDevice 0x887a002d error

Viewed 3996

First I am learning DirectX 11 from Frank Luna book I came to the part where I need to create the device, but it gives the error: "0x887a002d: The application requested an operation that depends on an SDK component that is missing or mismatched." I kept searching, I tried deferent solutions but nothing did it,

Solutions I tried: 1)I am using the DirectX library that comes with visual studio 2015, so I installed it.(correctly) 2)I tried changing it to D3D11CreateDeviceAndSwapChain but it also gave the same error

I have DirectX SDK(June 2010) hooked up to the project(and yes I want to use DirectX legacy SDK).

My code:

HRESULT hr;
UINT CreateDeviceFlags = 0;
D3D_FEATURE_LEVEL featureLevel;
UINT m4xMsaaQuility;


    #if defined(DEBUG) || defined(_DEBUG)
      CreateDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
    #endif

hr = D3D11CreateDevice(
    0,
    D3D_DRIVER_TYPE_HARDWARE,
    0,
    CreateDeviceFlags,
    0, 0,
    D3D11_SDK_VERSION,
    &m_pDevice,
    &featureLevel,
    &m_pDeviceContext);

if (FAILED(hr))
{
    return -1;
}

Includes:

#include <iostream>
#include <Windows.h>

#include <d3d11.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#include <DirectXColors.h>

// Link Library Dependencies
#pragma  comment(lib, "d3d11.lib")
#pragma  comment(lib, "dxgi.lib")
#pragma  comment(lib, "d3dcompiler.lib")
#pragma  comment(lib, "winmm.lib")
1 Answers
Related