menu
 

AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

0 支持
After finally sorting out my projects with my previous linker errors I am getting a new "unresolved external symbol" linker error when trying to use GetIDFromString function in AkSoundEngine.h.  Could anyone help with solving this please?  I am working in a C++ project and I have the integration working fine when using blueprints but seem to still have some troubles in a C++ project.

 

Thanks,

 

Jared
関連する回答: Linker errors in UE4 c++ project
Jared M. (220 ポイント) General Discussion

回答 1

+1 支持
 
ベストアンサー
If this code is in a seperate module (that has its own *.build.cs script), you should add the dependency to AkAudio there as well.

Where are you trying to add this code?
Benoit S. (Audiokinetic) (16.0k ポイント)
Jared M. 選択
I am trying to add it to my C++ Game Project.  So for example my project is called MyProject.  In MyProject.build.cs I have the following:

        public MyProject(TargetInfo Target)
    {
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

        PrivateDependencyModuleNames.AddRange(new string[] {  });

                if (UEBuildConfiguration.bCompileAudiokinetic == true)
                {
                    PublicDependencyModuleNames.Add("AkAudio");
                }
        }

Do I need to do more than that?  Inside any of the cpp files in my Game project, if I try to do something like AK:SoundEngine::GetIDFromString("String");  I get the unresolved symbol linker error.

Thanks
That is because your game isn't linking against the Wwise SDK libraries; the AkAudio module (found in the engine) is.

We have wrapped all Wwise SDK functionality in the FAkAudioDevice. Should you want to add some functionality to it, feel free to do so.

For example, you could add GetIDFromString to the FAkAudioDevice (found in UE4\Engine\Source\Runtime\AkAudio\Private\AkAudioDevice.cpp), and then, from your game code, add this:

#include "AkAudioDevice.h"

[...]

FAkAudioDevice* AudioDevice = FAkAudioDevice::Get();
if (AudioDevice)
{
    uint32 WwiseID = AudioDevice->GetIDFromString("MyString");
}

In other words, the FAkAudioDevice is the UE4 wrapper to the AK::SoundEngine workspace. Use this within your game.
Ok great.  The thought had crossed my mind to do that, since I noticed that GetIDFromString is being used in the engine source for AkReverbVolumes but I wasn't sure if that was the "right" way to do it.  Still need to the way UE4 builds its projects and adds in modules and libraries.  Thanks!
...