x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

BatteryCollector Issue

Hello! I've been following the BatteryCollector series from UE'S Website under the Learn tab and i've encountered many issues.One of them is the following:

On part 6 of the series at the end of the video, she Compiles the game from within the code using VS's build function.However my build fails outputting this error:

EXEC : error : UnrealHeaderTool failed for target 'BatteryCollectorEditor' (platform: Win64, module info: C:\Users\stelios papamichail\Documents\Unreal Projects\BatteryCollector\Intermediate\Build\Win64\BatteryCollectorEditor\Development\BatteryCollectorEditor.uhtmanifest, exit code: OtherCompilationError (5)).

Any ideas?(If you need to see my code,let me know and i will edit the question)Thanks in advance.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 23 '17 at 04:34 PM in C++ Programming

avatar image

EnergeticPixel
6 1 2 2

avatar image arrpeatwo4 Jun 23 '17 at 06:54 PM

UE4's stack trace's can be kind of cryptic especially when it comes errors in the Header files as you've seen - "Other Compilation Error(5)"

I'd recommend checking the "Output" tab of visual studio for more information on the error. If you could do that and upload that text here, I could probably help you out a bit more.

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

2 answers: sort voted first

Because of the new IWYU, make sure you include everything you use. For example:

 #include "Classes/Components/BoxComponent.h"

 #include "Classes/Components/StaticMeshComponent.h"

This was suggested by TB, some guy commenting under the video ;P Let me know if it helped! <3

more ▼

answered Jun 23 '17 at 04:41 PM

avatar image

Ninjin
4.1k 88 38 152

avatar image EnergeticPixel Jun 24 '17 at 09:28 AM

Hey there, thanks for helping me out.I'll post my code below(both .cpp and .h) because I've already added what you said but that sadly didn't help.

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "BatteryCollector.h"
 #include "Classes/Components/BoxComponent.h"
 #include "SpawnVolume.h"
 #include "Kismet/KismetMathLibrary.h"
 
 
 // Sets default values
 ASpawnVolume::ASpawnVolume()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = false;
 
     // Create the box component to represent the spawn volume(area)
     WhereToSpawn = CreateDefaultSubobject<UBoxComponent>(TEXT("WhereToSpawn"));
     RootComponent = WhereToSpawn;
 }
 
 // Called when the game starts or when spawned
 void ASpawnVolume::BeginPlay()
 {
     Super::BeginPlay();
     
 }
 
 // Called every frame
 void ASpawnVolume::Tick(float DeltaTime)
 {
     Super::Tick(DeltaTime);
 
 }
 
 FVector ASpawnVolume::GetRandomPointInVolume()
 {
     FVector SpawnOrigin = WhereToSpawn->Bounds.Origin;
     FVector SpawnExtent = WhereToSpawn->Bounds.BoxExtent;
 
     return UKismetMathLibrary::RandomPointInBoundingBox(SpawnOrigin, SpawnExtent);
 }


 
avatar image EnergeticPixel Jun 24 '17 at 09:29 AM
    // Fill out your copyright notice in the Description page of Project Settings.
     
     #pragma once
     
     #include "CoreMinimal.h"
     #include "GameFramework/Actor.h"
     #include "SpawnVolume.generated.h"
     
     UCLASS()
     class BATTERYCOLLECTOR_API ASpawnVolume : public AActor
     {
         GENERATED_BODY()
         
     public:    
         // Sets default values for this actor's properties
         ASpawnVolume();
     
     protected:
         // Called when the game starts or when spawned
         virtual void BeginPlay() override;
     
     public:    
         // Called every frame
         virtual void Tick(float DeltaTime) override;
     
         // Returns the wheretospawn subobject
         FORCEINLINE class UBoxComponent* GetWhereToSpawn() const { return WhereToSpawn; }
     
         // Find a random point within the BoxComponent
         UFUNCTION(BlueprintPure,Category = "Spawning")
         FVector GetRandomPointInVolume();
     
     private:
         // Box component to specify where pickups should be spawned
         UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spawning", meta = (AllowPrivateAccess= "true"));
         class UBoxComponent* WhereToSpawn;
         
     };
 

Hopefully you can help me out again :D ! Thanks in advance.

avatar image Ninjin Jun 24 '17 at 08:30 PM

I can't find the problem. Can you do what arrpeatwo4 asks for or upload the project, so it's easier for people to just go straight in without recreating the tutorial? <3

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

You put a semi-colon at the end of a UPROPERTY( ) macro:

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spawning", meta = (AllowPrivateAccess= "true"));
 class UBoxComponent* WhereToSpawn;

Change it to:

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spawning", meta = (AllowPrivateAccess= "true"))
 class UBoxComponent* WhereToSpawn;
more ▼

answered Jun 25 '17 at 02:30 AM

avatar image

Vawx
466 13 11 26

(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