在Windows 7上使用XAudio2进行构建 [英] Building with XAudio2 on Windows 7

查看:215
本文介绍了在Windows 7上使用XAudio2进行构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下说明来构建一些使用XAudio2并在Windows 7上运行的代码:

I'm trying to use the following instructions to build some code that uses XAudio2 and runs on Windows 7:

http://msdn.microsoft.com/en-us/library/windows /desktop/ee663275%28v=vs.85%29.aspx

如建议的那样,我包括DirectX SDK中的XAudio2.h:

As suggested, I'm including the XAudio2.h from the DirectX SDK:

#include <%DXSDK_DIR%Include\xaudio2.h>

结果:

fatal error C1083: Cannot open include file: '%DXSDK_DIR%Include\xaudio2.h': No such file or directory

哦,好。我非常确定VC ++不会像那样扩展环境变量。因此,我用直接包含 #include 的替换了它:

Oh well. I was pretty sure VC++ didn't expand environment variables like that anyway. So I replaced the #include with one that included it directly:

#include <C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include/XAudio2.h>

(某些其他说明,也建议使用完整路径,请参见: http://博客。 msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx

(Some other instructions, that also suggest using the full path, can be found here: http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx)

结果:

c:\program files (x86)\microsoft directx sdk (june 2010)\include\xaudio2.h(20): fatal error C1083: Cannot open include file: 'comdecl.h': No such file or directory

果然,该文件使用尖括号包含 comdecl.h ,指示VC ++在当前文件夹之外查找。

Sure enough, that file includes comdecl.h using angle brackets, directing VC++ to look outside the current folder.

我将DirectX SDK的include文件夹( $(DXSDK_DIR)/ include )添加到项目#include搜索路径中,然后保持#include不变,并:

I added the DirectX SDK include folder ($(DXSDK_DIR)/include) to the project #include search path then, leaving the #include as it was, and:

c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgitype.h(12): warning C4005: 'DXGI_STATUS_OCCLUDED' : macro redefinition
       c:\program files (x86)\windows kits\8.0\include\shared\winerror.h(49449) : see previous definition of 'DXGI_STATUS_OCCLUDED'

(...ad infinitum)

(我的项目包括

如果我在搜索路径列表的另一端添加了DirectX SDK包含文件夹,则结果相同。

Same result if I added the DirectX SDK include folders to the other end of the search path list.

在遵循这些(或任何其他)说明时,是否有人设法使其中的任何内容起作用?

Has anybody managed to get any of this to work while following these (or any other) instructions?

推荐答案

对不起,我知道我对此事迟到了

Hey sorry I know I'm late on this but this article

https://directxtk.codeplex.com/wikipage?title=添加% 20the%20DirectX%20Tool%20Kit%20for%20Audio

详细说明了如何包含旧版i包含和库。需要注意的一件事是,据我所知,包括这些目录后,您将依赖于Windows 8和10没有的Microsoft DirectX SDK(2010年6月)目录。这意味着当您打包项目时,应包括/运行旧版DirectX Redist,以便在较新的计算机上进行安装。

details how you need to include the legacy includes and libs. One thing to note, as I understand it after including these directories you will then have dependencies on the Microsoft DirectX SDK (June 2010) directory which windows 8 and 10 don't have. This means when you go to package up your project you should include/run the legacy directx redist for installation on newer machines.

您可能已经解决了此问题,但希望找到这个的其他人都会看到这个。希望对您有所帮助!

You've probably already solved this issue but hopefully anyone else who finds this will see this. Hope it helps!

这篇关于在Windows 7上使用XAudio2进行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆