Reputation: 31
I'm new using visual studio and unreal engine (but I learnt c++ previously). I'm in trouble right now. Let me explain :
I use Unreal engine 4.9.2 and visual studio 2013 update 4 (that has been installed) from UE.
When first open VS while creating a new project I have this error message :
but then VS opens normally.
Later, when I create a new actor in UE and that I try to build it adding just this line :
UPROPERTY(EditAnywhere)
I have 2 brand new error messages :
Error 1 error code: OtherCompilationError (5) E:\Documents\Unreal Projects\test4\Intermediate\ProjectFiles\Error test4
Error 2 error MSB3073: The command ""E:\programmes\unrealengine\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat" test4Editor Win64 Development "E:\Documents\Unreal Projects\test4\test4.uproject" -rocket -waitmutex" exited with code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 test4
What I tried to do to fix it : - remove and install again unreal engine and visual studio : same issues.
install visual studio from another source and then install unreal engine (removing both and rebooting before, obviously) : same issues.
Install Unreal Engine 4.10 => other issue, I'm not able to install Visual Studio 2015 (the installer packed with UE fails).
Using UE 4.10 Install Visual studio 2015 from another source : same Issues
Uninstall all and retry with UE4.9 and VS2013 : same issues
The complete source code of the header (the .cpp file has not been modified, it is still blank):
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
UCLASS()
class TEST4_API AMyActor : public AActor
{
GENERATED_BODY()
UPROPERTY(EditAnywhere)
public:
// Sets default values for this actor's properties
AMyActor();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
Honestly I learnt at school how to program using makefiles and linux but with an IDE, I am a total beginner. I hope someone will be able to help me. Thanks in advance.
PS : I apologize if I made grammar mistakes but english is not my native language.
Upvotes: 0
Views: 6122
Reputation: 64
Try:
#pragma once
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
UCLASS()
class TEST4_API AMyActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMyActor();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
I think your problem is not immediately following UPROPERTY(EditAnywhere) with a variable. Standard syntax of UPROPERTY is:
UPROPERTY([specifier, specifier, ...], [meta=(key=value, key=value, ...)])
Type VariableName;
For more info: https://wiki.unrealengine.com/UPROPERTY
Upvotes: 0