Sign in to follow this  
Fredericvo

Targetting Win7 with XAUDIO2

Recommended Posts

Fredericvo    1765

I wanted to give XAUDIO2 a shot and after compilation I got missing xaudio2_8.dll errors on my windows 7 system.

I use VS 2012 Express and the win8 SDK, as recommended by MS for DirectX 11 development.

After a few Google searches and articles read it seems that this is normal as it's a Windows 8 dll not found on a 7 system.

Apparently, the solution to target "down" is to include the xaudio.h header file from the June 2010 SDK. Now, I don't want to undo all my efforts to forget about this SDK and legacy D3DX cruft and add the June 2010 SDK again to my VC++ include directories because then it will again include the wrong stuff for everything else and I will again get macro redifinition warnings which I believe are only the top of an iceberg of other hidden problems. I googled further and found this solution:

#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
#include <xaudio2.h>
#pragma comment(lib,"xaudio2.lib")
#else
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\comdecl.h>
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2.h>
#endif
 
However, it still claims comdecl.h and a myriad of others can't be found, and the file where this happens is xaudio2.h, which I assume includes comdecl the relative way. I hope there is a better solution than to modify xaudio2.h ?
 
It seems that I'm not the only one struggling with this:
 
 
 
 
 

Share this post


Link to post
Share on other sites
Buckeye    10747

I don't know how deep you want to get into xaudio2, but you may want to look into the DirectX Toolkit. In particular, look at Audio.h in that package and see if the wrapper serves your needs. It uses DX SDK libraries but you can load them by full path without adding the DXSDK to your include/library directories -

 

#pragma comment(lib,"c:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\lib\\x86\\x3daudio.lib")
#pragma comment(lib,"c:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\lib\\x86\\xapofx.lib")


That approach, of course, adds the DXTK libraries to your dependencies, but may get you started. The DXTK may also provide you with an implementation approach you can work with.

Edited by Buckeye

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this