rn.log

備忘録など

【Visual Studio 2015 Community】d3dx9.hがインクルードできない

筆者はWindows10 (64bit), Visual Studio 2015 Commmunityを使っている。



ある日DirectXを触ろうと思って d3dx9.h をincludeしようとした

f:id:r-ngtm:20160722092712p:plain



ところがコンパイルエラーが出た.  cannot open source file "d3dx9.h"

f:id:r-ngtm:20160722092817p:plain




インクルードディレクトリにd3dx9.hのパスを追加しないとダメらしい

追加するためにはまず、 Project > (Project名) Propertiesを選択
f:id:r-ngtm:20160722093245p:plain




VC++ Directories > Include Directories を開く。 Platformは x64 にしておく
f:id:r-ngtm:20160722093206p:plain




パスを追加。 
f:id:r-ngtm:20160722093924p:plain




エラーがとれた。
f:id:r-ngtm:20160722094040p:plain




Solution Platformをx64にしないとエラーが取れないので注意。
f:id:r-ngtm:20160722094127p:plain




C:\Program Files (x86)\Microsoft DirectX SDK (June 2010) がない場合は下記URLからインストーラーをダウンロードしてきて実行すると良い
Download DirectX Software Development Kit from Official Microsoft Download Center