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
As suggested, I'm including the XAudio2.h from the DirectX SDK:
#include <%DXSDK_DIR%Include\xaudio2.h>
Result:
fatal error C1083: Cannot open include file: '%DXSDK_DIR%Include\xaudio2.h': No such file or directory
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>
(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)
Result:
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
Sure enough, that file includes comdecl.h
using angle brackets, directing VC++ to look outside the current folder.
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)
(my project includes the DirectX headers as well.)
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?