开发者

Problem setting up Direct X for C++

开发者 https://www.devze.com 2022-12-28 21:28 出处:网络
I\'ve downloaded Direct X SDK from the microsoft website but when I try to compile my code i\'m getting this error:

I've downloaded Direct X SDK from the microsoft website but when I try to compile my code i'm getting this error:

Error   1   error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "void __cdecl initD3D(struct HWND__ *)" (?initD3D@@YAXPAUHWND__@@@Z)    C:\Users\Josh\Desktop\Tutorial\开发者_如何学JAVATutorial\Tutorial.obj    Tutorial

I have added Direct X to my C++ build directories like that:

$(DXSDK_DIR)include
$(DXSDK_DIR)Lib\x64

I've googled it and found out that most of the time people were forgetting this line:

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

But it's there for me here are my includes and lib:

#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>

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

Can anyone help me with this? I'm using Visual studio 2010 Professional on win7 x64


Ok i've found the solution i've changed x64 to x86 in the build path. I was originally developping this project on a 32 bits machine so I guess the libraries weren't compatible. thanks for the help.

0

精彩评论

暂无评论...
验证码 换一张
取 消