XAudio2

When initializing xAudio2 in Eclipse there comes an error: undefined reference to `XAudio2Create'.

1
2
3
    IXAudio2* pXAudio2 = nullptr;
    if (FAILED(hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
        cout << hr;


What is causing this, and what is the solution?
Last edited on
Sound like a linker error. Probably you did not link the required import library.

Try linking with Xaudio2.lib, as described here:
https://learn.microsoft.com/en-us/windows/win32/api/xaudio2/nf-xaudio2-xaudio2create#requirements
Last edited on
Topic archived. No new replies allowed.