Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been programming professionally for years using languages like VBScript, JavaScript, and C#. As a hobby, I'm getting into some c/c++ and games programming with DirectX.

I am running into an issue where I cannot create direct3d objects. I am using Visual C++ 2010 Express. After I installed vc++2010express I then installed the June 2010 release of DirectX.

I am trying to include DirectX via #pragma statements. This is the code I have so far in my winmain.cpp source file:

#include <Windows.h>
#include <d3d11.h>
#include <time.h>
#include <iostream>
using namespace std;

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")

// program settings
const string AppTitle = "Direct3D in a Window";
const int ScreenWidth = 1024;
const int ScreenHeight = 768;

// direct3d objects
LPDIRECT3D11 d3d = NULL; // this line is showing an error

The type LPDIRECT3D11 is showing an error:

Error: Identifier "LPDIRECT3D11" is undefined

Am I missing something here to get VC++2010Express to recognize and load the DirectX libs?

Thanks for any help.

share|improve this question
up vote 2 down vote accepted

As the compiler accurately tells you, there is no type called LPDIRECT3D11 defined by D3D11's interface. Creating an ID3D11Device must be done through an IDXGIFactory, and there are a couple of one-step helper functions, but there is no equivalent to IDirect3D9 in D3D11.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.