The problem seems to be that you added "DX9\" to your pragma link command but in your post you say that the .lib - files aren't in the DX9 subdirectory, but in the same path as the rest of the files.
Try using
#pragma link "d3d9.lib"
#pragma link "d3dx9.lib"
#pragma link "d3dx9d.lib"