Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Another unresolved external symbol Linker error UE4

0 votes
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
related to an answer for: Linker errors in UE4 c++ project
asked Dec 9, 2014 in General Discussion by Jared M. (220 points)

1 Answer

+1 vote
 
Best answer
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?
answered Dec 10, 2014 by Benoit S. (Audiokinetic) (16,020 points)
selected Dec 10, 2014 by 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!
...