Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling/building for a non-server configuration (C4716: function must return a value) #10

Closed
chris-gong opened this issue Jul 20, 2020 · 1 comment · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@chris-gong
Copy link
Owner

The project compiles fine in Visual Studio for a server configuration, but these errors occur when trying to build the project for an editor/client configuration:

'AGameLiftTutorialGameMode::StopBackfillRequest': must return a value
'AGameLiftTutorialGameMode::CreateBackfillRequest': must return a value

This is only for the master branch and occurred when I added new methods in the GameLiftTutorialGameMode.cpp class, but didn't add return statements outside of the #if WITH_GAMELIFT and #endif compiler directives for a couple of new functions. The #if WITH_GAMELIFT directive only evaluates to true when the build target is of type server. However, the CreateBackfillRequest and StopBackfillRequest methods have non-void return types. Therefore, we need return statements outside of the compiler directives. Otherwise, when building for a non-server configuration, Visual Studio will think that the function has no return statement, which is syntactically incorrect for any function written in C++ that returns something.

@chris-gong chris-gong added the bug Something isn't working label Jul 20, 2020
@chris-gong chris-gong self-assigned this Jul 20, 2020
@chris-gong
Copy link
Owner Author

This pr, #11, fixes this issue.

chris-gong added a commit that referenced this issue Jul 20, 2020
Fixed issue #10 by adding additional return statements to a couple of methods in the GameLiftTutorialGameMode class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant