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.


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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