【发布时间】:2015-11-07 15:49:12
【问题描述】:
这也发布到了 Unreal 的 AnswerHub,但它们的响应速度很慢,我想知道这是 Unreal Engine 错误还是 Visual Studio 2013/C++ 一般错误。我想如果这是一个一般错误,那么 StackOverflow 会指出它。
基本上无缘无故,Visual Studio 开始在正确检测代码时遇到问题,说空函数内有未知符号,然后它开始说已经工作的代码中有未声明的标识符,或者“->”是未知的,等等. 一个不同的文件给了我这些错误http://i.imgur.com/AVrbdTS.png?1 下面是我用来显示我的问题的代码。当我再次尝试时,它说它无法打开 ToggleForBP.generated.h
这是 Visual Studio 2013 还是虚幻引擎的错误?
我的 .h // 在项目设置的描述页面填写您的版权声明。
#pragma once
#include "GameFramework/Actor.h"
#include "ToggleForBP.generated.h"
UCLASS()
class PLAYGROUND_API AToggleForBP : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AToggleForBP();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick(float DeltaSeconds) override;
//Toggles between on and off
void SwitchOnOff();
bool UniqueValueBlah;
};
我的 .cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "Playground.h"
#include "ToggleForBP.h"
// Sets default values
AToggleForBP::AToggleForBP()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
void SwitchOnOff()
{
UniqueValueBlah = true;
}
// Called when the game starts or when spawned
void AToggleForBP::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AToggleForBP::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
我从上面的代码中得到的错误:
Error 2 error : Failed to produce item: D:\Unreal Projects\Playground\Binaries\Win64\UE4Editor-Playground-3827.dll D:\Unreal Projects\Playground\Intermediate\ProjectFiles\ERROR Playground
Error 1 error C2065: 'UniqueValueBlah' : undeclared identifier D:\Unreal Projects\Playground\Source\Playground\ToggleForBP.cpp 18 1 Playground
Error 3 error MSB3073: The command ""D:\Programs\Epic Games\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat" PlaygroundEditor Win64 Development "D:\Unreal Projects\Playground\Playground.uproject" -rocket -waitmutex" exited with code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 Playground
4 IntelliSense: identifier "UniqueValueBlah" is undefined d:\Unreal Projects\Playground\Source\Playground\ToggleForBP.cpp 18 2 Playground
【问题讨论】:
标签: c++ unreal-engine4 undeclared-identifier