For some reason, whenever I call Direct3DCreate9(D3D_SDK_VERSION) inside a class' member function such as:
I get the following linker error:Code:HRESULT D3DControlObj::InitD3D(HWND hWnd) { if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) { return E_FAIL; } }
D3D error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "public: long __thiscall D3DControlObj::InitD3D(struct HWND__ *)" (?InitD3D@D3DControlObj@@QAEJPAUHWND__@@@Z)
but when I call it in a function in my main.cpp file it works fine.
I really want to be able to use OOP and have a class that contains all of my Direct3D stuff usage. Any ideas on how to resolve this?Code:HRESULT InitD3D(HWND hWnd) { if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) { return E_FAIL; } }