Link error

closed account (jwkNwA7f)
I have been googling this for a while now, but nothing I have found will work.
I am getting this error:
error LNK2019: unresolved external symbol _D3DXCreateSprite@8 referenced in function "public: void __thiscall 
Graphics::initialize(struct HWND__ *,int,int,bool)" (?initialize@Graphics@@QAEXPAUHWND__@@HH_N@Z)

I have included d3d9.h and d3dx9.h in Graphics.h. I have also added d3d9.lib to the project.

Thank you!
The function you are looking for, "_D3DXCreateSprite()" can be found in "d3dx9d.lib" in the Microsoft DirectX SDK. It is distinctly different from 'd3d9.lib' which is in the regular Microsoft SDK.
closed account (jwkNwA7f)
Thanks for the reply. It says it can't open the file 'd3dx9d.lib'

Edit: I have located the file in the same folder as d3d9.lib
Last edited on
Does it say why it can't open it? That's a very strange error.
closed account (jwkNwA7f)
I think I need to tell to search for the .lib file in another directory, but I am not sure how. I could find out how to do it in VS2010 but not in 2012.
closed account (jwkNwA7f)
I found how to do it. Thank you!
closed account (jwkNwA7f)
Well, actually I still have a problem :(
I have put the path for the directory that has 'd3dx9d.lib' to the additional library dependencies under linker->General, and then I added 'd3dx9d,lib' to the additional dependencies under linker->input. It didn't say it couldn't find the file, so apparently it can open it. But, I am still getting the same errors.

Edit: I fixed it.
Last edited on
Topic archived. No new replies allowed.