Original Post
I've recreated the "Hello D3D" example from "Introduction to 3D Game Programming with DirectX 9.0c- A Shader Approach", in VC++05, with a couple of changes. The changes I made are to the structure of all the #includes, to make things a little simpler (to me), based on the approach of this gdnet article. I haven't changed any of the functions of the app, nor the macro used to handle the returns of D3D functions. After much fiddling, I've fixed all of the compile errors, and I thought I had it done when the ouput window told me: 1>------ Build started: Project: D3D Base Project, Configuration: Debug Win32 ------ 1>Compiling... 1>d3dApp.cpp 1>Linking... , but then I got a bunch of link errors, 2 of which look like this: 1>d3dApp.obj : error LNK2019: unresolved external symbol _DXTraceA@20 referenced in function "public: virtual void __thiscall D3DApp::initDirect3D(void)" (?initDirect3D@D3DApp@@UAEXXZ) 1>HelloD3D.obj : error LNK2001: unresolved external symbol _DXTraceA@20 The rest follow the same basic pattern. In this project, all returns from DX functions are handled with the macro HR(x), ie HR(gd3dDevice->Reset(&md3dPP)). The macro looks like this So I think those link errors are saying that something is going wrong when DXTrace is called when handling the return of a DX function, which is being called from inside the function initDirect3D. Or something like that. But if DXTrace is being called, doesn't that mean that the DX functions are failing? I don't really know what's going on, can anyone help? cheers, metal
#define HR(x)
{
HRESULT hr = x;
if(FAILED(hr))
{
DXTrace(__FILE__, __LINE__, hr, #x, TRUE);
}
}