When I declare a UFUNCTION with the tags Server, WithValidation, Reliable I get a warning that I should declare FunctionName_Implementation since UHT will stop auto-generating it in a future release. If I just declare the implementation function I get an error (declaring a function that has already been declared) but if I also declare the validate function it compiles fine. The warning should probably make mention of the validate function to cut down on confusion.
Hey -
How are you setting up your UFUNCTION macro? Could you provide the header and source file from the class that you are testing?
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.
Sorry, we were in the middle of crunch and this got forgotten.
I declare a function like so:
UFUNCTION(Server, WithValidation, Reliable)
void Test();
and the warning I get is “Function BugReportsCharacter::Test needs native implementation by virtual void Test_Implementation() due to its properties. Currently Test_Implementation declaration is autogenerated by UHT. Since next release you’ll have to provide declaration on your own. Please update your code before upgrading to the next release, otherwise your project will no longer compile.”
So when I do as it suggests and declare the function
void Test_Implementation();
I get the error: “‘void ABugReportsCharacter::Test_Implementation(void)’ : member function already defined or declared”
If I also declare
bool Test_Validate();
then I don’t get any errors.
Hey -
When I add
UFUNTION(Server, WithValidation, Reliable)
void Test();
to a class I receive the warning you mentioned however I also receive an error
stating : “error C2338: Function Test was marked as Native, Net, NetValidate. Declare function bool void(Test_Validate) in class.” Do you receive this error as well or do you only get the warning in VS?
I only receive the warning (using VS2013 in case that makes a difference). I do have Test_Validate implemented in my cpp file though; it’s just not declared in the header.
Hey -
I’ve updated to 4.7.4 and tested this again and receive an error prompting me to include a “Validate” function in my error log. Can you try updating your engine version and trying this again?
Updated to 4.7.4 and I still only get the warning, no error. Not sure what the difference between yours and mine could be.
Hey -
I’ve entered a feature request to make the warning message clearer and give a better indication of what needs to be fixed.
Cheers