• Advertisement
Sign in to follow this  

DirectX SDK Sample (3D Audio) gives me unresolved external when implementing?

This topic is 1976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm not sure if this is the right forum for XAudio2 questions,it was in the DirectX SDK...so the problem is this:When I implement the XAudio2Sound3D sample from the June 2010 SDK.I pretty much copied it all in my own framework and this one variable(sound3DInstance) shows up as an unresolved external: X3DAudioCalculate(sound3DInstance, &listener, &emitter, calcFlags, &dspSettings); and X3DAudioInitialize(details.OutputFormat.dwChannelMask, SPEEDOFSOUND, sound3DInstance);
Where the variable types are:

X3DAUDIO_HANDLE sound3DInstance;
X3DAUDIO_LISTENER listener;
X3DAUDIO_EMITTER emitter;
X3DAUDIO_DSP_SETTINGS dspSettings;
DWORD calcFlags = X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_LPF_DIRECT | X3DAUDIO_CALCULATE_LPF_REVERB | X3DAUDIO_CALCULATE_REVERB;
const float SPEEDOFSOUND = X3DAUDIO_SPEED_OF_SOUND;
XAUDIO2_DEVICE_DETAILS details;

Now the only common variable in both functions that show the error is sound3DInstance,so that has to be the problem.In the SDK Sample all the variables are put in a struct called AUDIO_STATE and in the initialization of the program,they call:
ZeroMemory( &g_audioState, sizeof( AUDIO_STATE ) );
In my code the variables are members of my Sound class and I just ZeroMemory them one by one,so shouldn't the effect be the same?

Share this post


Link to post
Share on other sites
Advertisement
That's because you have to link to their corresponding libraries. Try this:

#pragma comment(lib, "x3daudio")
#pragma comment(lib, "xaudio2")

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement