Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 mrheisenberg   Members   -  Reputation: 356

Like
0Likes
Like

Posted 24 August 2012 - 01:59 PM

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?

Sponsor:

#2 Asesh   Members   -  Reputation: 268

Like
0Likes
Like

Posted 26 August 2012 - 09:35 AM

That's because you have to link to their corresponding libraries. Try this:

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS