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. 

Suddenly compiling any project with C++ in it gives me undeclared identifier errors [closed]

It all started with a blank function in C++ giving me this weird error saying there was an unidentified symbol. It was blank and I didn't need it so I deleted that code eventually, no big deal. Then it started happening with everything new. After trying for over an hour I restarted my computer thinking it might be some weird VS glitch, but it still happened. Now it is even happening on old projects that had zero issues. It keeps giving me declared identifier errors. Here are the errors it gave me with a different file http://i.imgur.com/AVrbdTS.png?1

Should I reinstall VS2013 and/or Unreal 4.9?

EDIT: I updated my VS2013 and tried to clean rebuild the files. Now it says (or maybe it did before and I somehow missed it) that it cannot open up the ToggleForBP.generated.h file. I check to make sure it wasn't set on read only and it isn't. I am very confused right now.

My .h // Fill out your copyright notice in the Description page of Project Settings.

 #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;
 
 
 };


My .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 );
 
 }
 


The errors I get from VS2013

 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
 


Product Version: UE 4.9
Tags:
more ▼

asked Nov 07 '15 at 12:09 PM in C++ Programming

avatar image

PappySnail
41 7 9 13

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

1 answer: sort voted first

I realized this might be a general C++ error instead of Unreal Engine based and sure enough it was. Turns out I needed to add AToggleForBP:: to my function because without it the compiler thought I was calling a global function!

more ▼

answered Nov 07 '15 at 04:10 PM

avatar image

PappySnail
41 7 9 13

avatar image xy2015 Dec 15 '16 at 10:42 AM

didnt realize i forget the prefix until see your answer,i was so dumb,thanks for posting this.

(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