I’m currently building my project on OSX. Everything builds fine except for one line, which calls USoundCue::RecursiveFindNode(). The project builds fine in VS.
Undefined symbols for architecture x86_64:
"void USoundCue::RecursiveFindNode<USoundNodeWavePlayer>(USoundNode*, TArray<USoundNodeWavePlayer*, FDefaultAllocator>&)"
If I comment out this line, or replace this call with a call to USoundCue::RecursiveFindAllNodes() and use casting in my subsequent loop to identify the correct type, the code builds fine.
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
Sorry for dropping off the radar. Yes, the only line shown in the error is the one that uses RecursiveFindNode.
In terms of repro steps, it should be enough to simply get a valid reference to a SoundCue and call RecursiveFindNode() on it.
This snippet contains all I’m trying to do:
// Get sound from audio component
USoundCue* cue = Cast<USoundCue>(MyAudioComponent->Sound);
if(cue)
{
// Get all SoundNodeWavePlayers in the SoundCue.
TArray<USoundNodeWavePlayer*> wavePlayers;
cue->RecursiveFindNode<USoundNodeWavePlayer>(cue->FirstNode, wavePlayers);
for(int32 i = 0; i < wavePlayers.Num(); ++i)
{
// Do stuff with wave player
}
}
I’m getting a compile error related to “MyAudioComponent” when I try to copy the code you’re using. What is the data type for this variable? Also, what type of class is this code being added to? If possible could you post the full class where this code is being used so that I can try to setup a reproduction case on my end?
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
MyAudioComponent is of type UAudioComponent*. What is the compile error you are getting? I’ll try and create a simple class that demonstrates the error.
Since I didn’t know what type MyAudioComponent was the compiler wasn’t sure what to do with it. Now that I can define it properly I will try adding the code you posted to a class. If adding the code alone doesn’t reproduce the issue then a sample class/project that does demonstrate the issue would be helpful.
#include "Runtime/Engine/Classes/Sound/SoundNodeWavePlayer.h"
//added to class Tick() function
USoundCue* cue = Cast<USoundCue>(MyAudioComponent->Sound);
if(cue)
{
// Get all SoundNodeWavePlayers in the SoundCue.
TArray<USoundNodeWavePlayer*> wavePlayers;
cue->RecursiveFindNode<USoundNodeWavePlayer>(cue->FirstNode, wavePlayers);
for(int32 i = 0; i < wavePlayers.Num(); ++i)
{
// Do stuff with wave player
}
}