Fatal error LNK1104: cannot open file ‘d3dc9.lib’

directxdirectx-9dlllinkervisual studio 2010

I'm currently going though a game programming book and am trying to compile some directx9 code

I have the latests DirectX11 SDK and the code has these lines of code

#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")

But I get
LINK : fatal error LNK1104: cannot open file 'd3dc9.lib'

I don't know how to set it up to find this file although in fact I don't get why it asks for it since it isn't inside the Lib file for the DirectX 11 SDK and isn't what i've asked for.

Best Answer

The linker only knows the name of the .lib file, it doesn't know what directory it is stored in. Project + Properties, Linker, General, Additional Library Directories setting.

The version 11 SDK is quite new. You may need an older version of the SDK if these .libs are no longer distributed. I know the June 2010 edition has them. Download is here.

Related Topic