简体   繁体   English

虚幻引擎在Visual Studio中出现错误(MSB3073)

[英]error(MSB3073) in visual studio with unreal engine

I'm new using visual studio and unreal engine (but I learnt c++ previously). 我是使用Visual Studio和虚幻引擎的新手(但我以前学过C ++)。 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. 我从UE使用虚幻引擎4.9.2和Visual Studio 2013 Update 4(已安装)。

When first open VS while creating a new project I have this error message : 在创建新项目时第一次打开VS时,出现以下错误消息: 第一个VS实例错误

but then VS opens normally. 但是VS正常打开。

Later, when I create a new actor in UE and that I try to build it adding just this line : 稍后,当我在UE中创建一个新的actor并尝试添加以下代码来构建它时:

UPROPERTY(EditAnywhere)

I have 2 brand new error messages : 我有2条全新的错误消息:

Error 1 error code: OtherCompilationError (5) E:\\Documents\\Unreal Projects\\test4\\Intermediate\\ProjectFiles\\Error test4 错误1错误代码: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. 错误2错误MSB3073:命令““ E:\\ programmes \\ unrealengine \\ Epic Games \\ 4.9 \\ Engine \\ Build \\ BatchFiles \\ Build.bat” test4Editor Win64开发“ E:\\ Documents \\ Unreal Projects \\ test4 \\ test4.uproject”-火箭-waitmutex”以代码-1退出。 C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V120\\Microsoft.MakeFile.Targets 38 5 test4 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. 我试图解决的问题:-删除并重新安装虚幻引擎和Visual Studio: 相同的问题。

  • install visual studio from another source and then install unreal engine (removing both and rebooting before, obviously) : same issues. 从另一个来源安装Visual Studio,然后安装虚幻引擎(显然,将它们都移除并重新启动): 相同的问题。

  • Install Unreal Engine 4.10 => other issue, I'm not able to install Visual Studio 2015 (the installer packed with UE fails). 安装Unreal Engine 4.10 =>其他问题,我无法安装Visual Studio 2015(UE附带的安装程序失败)。

  • Using UE 4.10 Install Visual studio 2015 from another source : same Issues 使用UE 4.10从其他来源安装Visual Studio 2015: 相同的问题

  • Uninstall all and retry with UE4.9 and VS2013 : same issues 卸载全部并使用UE4.9和VS2013重试: 相同的问题

The complete source code of the header (the .cpp file has not been modified, it is still blank): 标头的完整源代码(.cpp文件尚未修改,仍为空白):

    // 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. 老实说,我在学校学习了如何使用makefile和linux进行编程,但是有了IDE,我完全是一个初学者。 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. PS:如果我犯了语法错误,我深表歉意,但英语不是我的母语。

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. 我认为您的问题不是立即在带有变量的UPROPERTY(EditAnywhere)之后。 Standard syntax of UPROPERTY is: UPROPERTY的标准语法为:
UPROPERTY([specifier, specifier, ...], [meta=(key=value, key=value, ...)]) Type VariableName;

For more info: https://wiki.unrealengine.com/UPROPERTY 有关更多信息: https : //wiki.unrealengine.com/UPROPERTY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM