   Directx9 SDK (summer 2003)
  I am trying to compile the basic.cpp from the 1st edition of Beginning Direct3D Game Programming, and I am encountering compile errors that do not make sense to me.I have installed the directx9 SDK into its default folder.  Naturally, I have to fix up the pathing to certain .cpp files in the project (d3dapp.cpp, d3xutil.cpp, etc.)Also, I took care of the usual Include and Source Directory references.The first part:C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(49) : error C2146: syntax error : missing '';'' before identifier ''m_d3dEnumeration''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(49) : error C2501: ''CD3DEnumeration'' : missing storage-class or type specifiersWhat''s getting me is the funky syntax error about a missing ;I definitely see the ; in its proper place.  The SDK is the latest one.  VC++6 has SP5.  I don''t get it.  I am assuming all the other errors about type specifiers I am getting is because of the ; syntax errors.Any ideas on what''s going on? 
  Hate to ask the obvious, but did you #include d3denumeration.h? ;  yep ... I added d3denumeration.h into the beginning of basic.cpp, and even added d3denumeration.cpp to the Common subfolder of the Project workspace.  Compiling gives me errors like this:C:\DX90SDK\SAMPLES\C++\COMMON\d3denumeration.h(32) : error C2146: syntax error : missing '';'' before identifier ''AdapterIdentifier''C:\DX90SDK\SAMPLES\C++\COMMON\d3denumeration.h(32) : error C2501: ''D3DADAPTER_IDENTIFIER9'' : missing storage-class or type specifiersOf course, there are more errors.  Syntax errors with D3DENUMERATION.H, D3DAPP.H, D3DFONT.H, D3DUTIL.H, and errors with BASIC.CPP (probably because of the syntax errors in the header files.)Unless there is a chain of .H and .CPP files I need to add, this shouldn''t be that hard. Randy Wong ;  I would check in your project Include and Library search paths that you have defined the path to the DX9SDK *before* the standard MSVC paths; I believe MSVC contains headers and libraries for an older version of DX and will find these first. I remember being hampered with this when I first started.. easy mistake to make. ;  Already did that.  Perhaps I should paste all the errors that are generated:--------------------Configuration: BASIC - Win32 Release--------------------Compiling...basic.cppC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(49) : error C2146: syntax error : missing '';'' before identifier ''m_d3dEnumeration''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(49) : error C2501: ''CD3DEnumeration'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(49) : error C2501: ''m_d3dEnumeration'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(50) : error C2146: syntax error : missing '';'' before identifier ''m_d3dSettings''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(50) : error C2501: ''CD3DSettings'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(50) : error C2501: ''m_d3dSettings'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(70) : error C2061: syntax error : identifier ''D3DCAPS9''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(94) : error C2146: syntax error : missing '';'' before identifier ''m_pD3D''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(94) : error C2501: ''LPDIRECT3D9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(94) : error C2501: ''m_pD3D'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(95) : error C2146: syntax error : missing '';'' before identifier ''m_pd3dDevice''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(95) : error C2501: ''LPDIRECT3DDEVICE9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(95) : error C2501: ''m_pd3dDevice'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(96) : error C2146: syntax error : missing '';'' before identifier ''m_d3dCaps''C:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(96) : error C2501: ''D3DCAPS9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(96) : error C2501: ''m_d3dCaps'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DApp.h(121) : error C2061: syntax error : identifier ''D3DCAPS9''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(38) : error C2146: syntax error : missing '';'' before identifier ''m_pd3dDevice''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(38) : error C2501: ''LPDIRECT3DDEVICE9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(38) : error C2501: ''m_pd3dDevice'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(39) : error C2146: syntax error : missing '';'' before identifier ''m_pTexture''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(39) : error C2501: ''LPDIRECT3DTEXTURE9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(39) : error C2501: ''m_pTexture'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(40) : error C2146: syntax error : missing '';'' before identifier ''m_pVB''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(40) : error C2501: ''LPDIRECT3DVERTEXBUFFER9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(40) : error C2501: ''m_pVB'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(48) : error C2146: syntax error : missing '';'' before identifier ''m_pStateBlockSaved''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(48) : error C2501: ''LPDIRECT3DSTATEBLOCK9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(48) : error C2501: ''m_pStateBlockSaved'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(49) : error C2146: syntax error : missing '';'' before identifier ''m_pStateBlockDrawText''C:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(49) : error C2501: ''LPDIRECT3DSTATEBLOCK9'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(49) : error C2501: ''m_pStateBlockDrawText'' : missing storage-class or type specifiersC:\DX90SDK\SAMPLES\C++\COMMON\D3DFont.h(67) : error C2061: syntax error : identifier ''LPDIRECT3DDEVICE9''C:\DX90SDK\SAMPLES\C++\COMMON\D3DUtil.h(38) : error C2065: ''LPDIRECT3DDEVICE9'' : undeclared identifierC:\DX90SDK\SAMPLES\C++\COMMON\D3DUtil.h(38) : error C2146: syntax error : missing '')'' before identifier ''pd3dDevice''C:\DX90SDK\SAMPLES\C++\COMMON\D3DUtil.h(39) : error C2059: syntax error : '')''Q:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(84) : error C2065: ''m_bUseDepthBuffer'' : undeclared identifierQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(117) : error C2065: ''m_pd3dDevice'' : undeclared identifierQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(117) : error C2227: left of ''->BeginScene'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(119) : error C2227: left of ''->SetStreamSource'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(120) : error C2227: left of ''->SetVertexShader'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(121) : error C2227: left of ''->DrawPrimitive'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(124) : error C2227: left of ''->EndScene'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(156) : error C2227: left of ''->SetTransform'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(157) : error C2227: left of ''->SetTransform'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(158) : error C2227: left of ''->SetTransform'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(162) : error C2227: left of ''->GetViewport'' must point to class/struct/unionQ:\_MyProgs\C++\BeginDirect3DGP\Part1\chapter5\basic\basic.cpp(178) : error C2227: left of ''->CreateVertexBuffer'' must point to class/struct/uniondxstdafx.cppError executing cl.exe.BASIC.exe - 48 error(s), 0 warning(s)========================================================Anyone every seen this before?  I look at the syntax errors and I don''t get it.  Semi-colons look good.  All the paths check out ... Randy Wong ;  Check that you have the sdk''s path in the ide''s include and lib path list. Check also that you''ve given the correct .libs for the linker. Something like dinput.lib, dxguid.lib etc. ;  hmmmmm ... I just had a "thinking outside the box" moment ....maybe I am approaching the problem in the wrong direction.The source code for this book used Directx8SDK, and the computer I having the problems with has the latest D9SDKLet me show you the top part of the basic.cpp program:========================================================//-----------------------------------------------------------------------------// File: basic.cpp//// Desc: D3D sample showing the basics of DirectX Graphics Programming// // Copyright (c) 1998-2000 Microsoft Corporation. All rights reserved.// Copyright (c) 1998-2001 wolf@direct3d.net//-----------------------------------------------------------------------------#define STRICT#include <tchar.h>#include <math.h>#include <stdio.h>#include <D3DX8.h>#include "D3DApp.h"#include "D3DFont.h"#include "D3DUtil.h"#include "DXUtil.h"#include "resource.h"============================================My gut feeling says that this top part is probably no longer vaid for DX9SDK ... that D3DX8.h is a sign, to be sure ... any comments on how this *should* look? Randy Wong ;  I use these:#include <D3D9.h>// Direct3D Header#include <D3DX9.h>// Direct3D Header  I have no problems compiling. Then again, I''m not using the summer 03 version of the SDK.Tom ;  hmmm, using Vis stud 6.0, win2000, dx9.0b, dx9.0sdk and the same book.I got the same errors and others too. Made sure all paths were correct, all .lib added, tried both sdk 8 and 9, added different and multiple paths. Nothing is working. The only way I got the common frameworks to work was using the directx(9) application wizard when u choose "New". Created tons of overhead though when all I really wanted was a stable fullscreen that kan be windowed and minimized and that checks hardware and such properly.If anyone has experienced these problems and found a sollution, I would very much appreciate it.sorry for my rusty english.SubLock ;  Are you using the DX8 book or the newer DX9 book?  I finally had to give in and get the DX9 book to get the code to work ... oh, also, better make sure your video card is full DX9 supported, or you will hit a brick wall sooner or later. 