USoundCue::RecursiveFindNode gives linker error on OSX

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.

Relevant lines in my code:

TArray<USoundNodeWavePlayer*> wavePlayers;
cue->RecursiveFindNode<USoundNodeWavePlayer>(cue->FirstNode, wavePlayers);

Linker error raised:

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.

Platform: OSX 10.9.5 (Mavericks)
Engine version: 4.9.0 binary release

Hey -

Were these the only lines shown when the compile failed? If you can reproduce the issue, can you post steps for me to test on my end?

Cheers

Hi ,

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.

Thank you.

Hi ,

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
	}
}

Hi ,

Please see my comment above.

Hey -

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?

Hey -

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.

Thank you.

Hi ,

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.

Hey -

I added the following code to an actor based class and compiled successfully in XCode:

.h

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
UAudioComponent* MyAudioComponent;

.cpp

#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
     }
 }