开发者

What is the difference between the x64 and x86 library files in DirectX?

I recently got Visual Studio on a new computer, and to set up DirectX on it, I went to Tools>Options>Projects and Solutions>VC++ Directories and under Library Files made a new entry C:\Program Files\Microsoft DirectX SDK (August 2009)\Lib\x86

and now ran a test program (ess开发者_JAVA技巧entially just initialized DirectX) and it worked fine. However, if I change ...\Lib\x86 to ...\Lib\x64, than I get a linker error that Direct3DCreate9 is undefined:

1>main.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "void __cdecl init(void)" (?init@@YAXXZ)


The x86 libraries are for 32-bit applications, and the x64 libraries are for 64-bit applications.

You can see which platform you are targetting in Visual Studio's Configuration Manager. Unless you have a good reason, you should be writing 32-bit applications, since 64-bit apps will require the 64-bit version of Windows to run.


The x64 folder contains the library files for the AMD64 platform (Windows 64 Bit). You need to compile your application for 64 bit, too. Also, you need the 64 bit version of Windows to run the produced executable.


Well the simple answer is that the x86 libraries are for 32 bit operating systems and the x64 libraries are for 64 bit operating systems.

Simply changing the DirectX library linked to will produce an error as you are (in all probability) trying to link your 32 bit code to the 64 bit library. You will need to compile your code to target 64 bit operating systems to get this to link successfully.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜