Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

TwinStickShooter Tutorial: VS Build Error

I'm following the tutorial except my project name is MobileFPS and it is in a custom directory. I try to build code to create the ABaseCharacter class but get 2 errors.

OtherCompilationError (5)

 1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
 2>------ Build started: Project: MobileFPS, Configuration: Development_Editor x64 ------
 2>  Creating makefile for hot reloading MobileFPSEditor (game project files are newer)
 2>  Compiling game modules for hot reload
 2>  Parsing headers for MobileFPSEditor
 2>    Running UnrealHeaderTool "C:\Users\Zachary\SkyDrive\Documents\Sunpeece Studios\Games\Mobile-FPS\MobileFPS\MobileFPS.uproject" "C:\Users\Zachary\SkyDrive\Documents\Sunpeece Studios\Games\Mobile-FPS\MobileFPS\Intermediate\Build\Win64\MobileFPSEditor\Development\MobileFPSEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
 2>  C:/Users/Zachary/SkyDrive/Documents/Sunpeece Studios/Games/Mobile-FPS/MobileFPS/Source/MobileFPS/BaseCharacter.h(26) : Function return type: Missing variable type
 2>Error : Failed to generate code for MobileFPSEditor - error code: OtherCompilationError (5)
 2>  UnrealHeaderTool failed for target 'MobileFPSEditor' (platform: Win64, module info: C:\Users\Zachary\SkyDrive\Documents\Sunpeece Studios\Games\Mobile-FPS\MobileFPS\Intermediate\Build\Win64\MobileFPSEditor\Development\MobileFPSEditor.uhtmanifest).
 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command ""C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" MobileFPSEditor Win64 Development "C:\Users\Zachary\SkyDrive\Documents\Sunpeece Studios\Games\Mobile-FPS\MobileFPS\MobileFPS.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
 ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Product Version: UE 4.12
more ▼

asked Jun 11 '16 at 07:32 PM in C++ Programming

avatar image

3 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

It tells you that you're missing a return type for a function: Function return type: Missing variable type on line 26 of BaseCharacter.h

( 2> C:/Users/Zachary/SkyDrive/Documents/Sunpeece Studios/Games/Mobile-FPS/MobileFPS/Source/MobileFPS/BaseCharacter.h(26) : Function return type: Missing variable type )

If that's not the issue then you'll need to post your BaseCharacter.h

more ▼

answered Jun 12 '16 at 08:46 AM

avatar image

596 28 24 52

avatar image Sunpeece Jun 12 '16 at 01:41 PM
 // Fill out your copyright notice in the Description page of Project Settings.
 #pragma once
 #include "GameFramework/Character.h"
 #include "BaseCharacter.generated.h"
 class MOBILEFPS_API ABaseCharacter : public ACharacter
     //Make a health property
     UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Base Character")
         float Health = 100;
     //Make an isDead property
     UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Base Character")
         bool isDead = false;
     //Calculate death function (helper)
     virtual void CalculateDead();
     //Calculate health function
     UFUNCTION(BlueprintCallable, Category = "Base Character");
     virtual void CalculateHealth(float delta);
     //Editor-centric code for changing properties
     virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
     // Sets default values for this character's properties
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
avatar image Vaei Jun 12 '16 at 08:45 PM

Line 26: UFUNCTION(BlueprintCallable, Category = "Base Character");

You have a semicolon following the UFUNCTION decorator, removing it will solve the issue.

That's a nonsensical error, I'm going to make a suggestion that they allow you to add a semicolon following the decorator (and for UPROPERTY and GENERATED_BODY) because it would also fix the indentation issues, or at least for them to provide a proper error when you do it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question