Download

Function name clash causing linker error, help?

I’m working on a plug-in to allow for some external sequencer controls and have run into a problem trying to get the current time in a sequence.
Due to the fact that I’m using some windows headers for my socket connections e.g. winsock and ws2tcpip there is a function name clash stopping me from being able to get the current time.
The UMovieSceneSequencePlayer::GetCurrentTime() is getting mixed up with the GetCurrentTime() found in winbase.h which then just stops the plug-in from compiling.
Does anyone know of any work-arounds or ways to handle this issue? I temporarily have it using blueprints to get the value but would ideally like to have everything done in c++.

So the compile issue only happens if you call GetCurrentTime() in your code? How are you calling the function and have you tried making a fully qualified function call?

Yeah, the blueprint node for UMovieSceneSequencePlayer::GetCurrentTime() works fine.
I get an array of ULevelSequenceActors called foundActors then the actual function call looks like this:
float num = foundActors[i]->SequencePlayer->GetCurrentTime().AsSeconds();

I haven’t tried that but also don’t know how to go about it.
I tested the same code out not as a plug-in and just as c++ classes in unreal and it all worked fine so maybe its got something to do with how plug-ins are compiled?