menu
 

La section Questions et réponses de la communauté Audiokinetic est un forum où les utilisateurs de Wwise et de Strata peuvent poser des questions et répondre à celles des autres membres de la communauté. Si vous souhaitez obtenir une réponse de la part de l'équipe de soutien technique d'Audiokinetic, veillez à utiliser le formulaire de Tickets de Soutien.

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
liée à une réponse: Linker errors in UE4 c++ project
dans General Discussion par Jared M. (220 points)

1 Réponse

+1 vote
 
Meilleure réponse
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?
par Benoit S. (Audiokinetic) (16.0k points)
sélectionné par 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!
...