Ok, so I have fixed error I had for over a week now. And actually it was ve-e-ery easy, if you know how to do it of course. If you have started programming on C# you think that all adds for you automagicaly. Once you use SpriteBatch in XNA – d2dcontex is loaded, you use text and d2writefactory is added, you play SoundEffect and XAudio2 is loaded. You don’t even know about this. Until you start doing it on C++ and DirectX.
You always need to specify what dependencies/libraries/references you going to use. I was trying to use XAudio2 and get nice error in this peace of code (this loads XAudio2 engine):
IXAudio2* m_engine; UINT32 flags = 0; DX::ThrowIfFailed( XAudio2Create(&m_engine, flags) ); error LNK2019: unresolved external symbol __imp__XAudio2Create@12 referenced in function "public: __thiscall XAudio2SoundPlayer::XAudio2SoundPlayer(unsigned int)" (??0XAudio2SoundPlayer@@QAE@I@Z)
This is Linker Error. This means you use something Linker can’t find. To show linker what you are using you should do this:
Project Properties -> Configurations Properties -> Linker ->Input -> Dependencies
and add the library you going to use. xaudio2.lib; in my case.
That’s it, it’s that easy ! As everything in C++ and DirectX !