Download

Errors with code from the start!

Hi all, so I’m new to posting here but loving the community so far :wink:

So I’ve been following all the steps from all the tutorials for adding code to project. Everything builds fine. That is, until I add my first class using the class wizard.

Scenario:
I create an Actor Class called Pickup. I made it public via the wizard. Pickup.h
The header’s code is as follows:


#pragma once

#include "GameFramework/Actor.h"
#include "Pickup.generated.h"

UCLASS()
class CLAUDIA_API APickup : public AActor
{
	GENERATED_UCLASS_BODY()

	
	
};

The include shows errors: cannot open source file “Pickup.generated.h”.
And GENERATED_UCLASS_BODY() shows error; expected an identifier.

And the .cpp file is Pickup.cpp
The code for that is as follows:


#include "ClaudiaPrivate.h"
#include "Pickup.h"


APickup::APickup(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{

}


It has errors too;
No instance of overloaded function “APickup::APickup” matches the specified type e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Source\Claudia\Private\Pickup.cpp ".

Here is the entire error list if it helps.


Error	1	error LNK1104: cannot open file 'E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Binaries\Win64\UE4Editor-Claudia.dll'	E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Intermediate\ProjectFiles\LINK	Claudia
Error	2	error : Failed to produce item: E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Binaries\Win64\UE4Editor-Claudia.pdb	E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Intermediate\ProjectFiles\ERROR	Claudia
Error	3	error MSB3073: The command ""E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Build\BatchFiles\Build.bat" ClaudiaEditor Win64 Development "E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Claudia.uproject"" exited with code -1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets	38	5	Claudia
	4	IntelliSense: declaration is incompatible with "FLogCategoryLogLockFreeList LogLockFreeList" (declared at line 6 of "E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Core\Public\Containers\LockFreeList.h")	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Core\Public\Containers\LockFreeList.h	6	10	Claudia
	5	IntelliSense: declaration is incompatible with "FLogCategoryLogObj LogObj" (declared at line 10 of "E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\CoreUObject\Public\UObject\UObject.h")	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\CoreUObject\Public\UObject\UObject.h	10	1	Claudia
	6	IntelliSense: declaration is incompatible with "FLogCategoryLogUObjectGlobals LogUObjectGlobals" (declared at line 12 of "E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\CoreUObject\Public\UObject\UObjectGlobals.h")	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\CoreUObject\Public\UObject\UObjectGlobals.h	12	17	Claudia
	7	IntelliSense: identifier "FOnSelectedLevelsChangedEvent" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\Engine\World.h	1929	2	Claudia
	8	IntelliSense: declaration is incompatible with "FLogCategoryLogActor LogActor" (declared at line 35 of "E:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h")	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h	35	12	Claudia
	9	IntelliSense: identifier "bHiddenEd" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h	1216	10	Claudia
	10	IntelliSense: identifier "bHiddenEdTemporary" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h	1232	52	Claudia
	11	IntelliSense: identifier "UParticleModuleEventSendToGame" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\Particles\ParticleSystemComponent.h	886	68	Claudia
	12	IntelliSense: identifier "UParticleModuleEventSendToGame" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\Particles\ParticleSystemComponent.h	899	68	Claudia
	13	IntelliSense: identifier "UParticleModuleEventSendToGame" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\Particles\ParticleSystemComponent.h	917	69	Claudia
	14	IntelliSense: identifier "UParticleModuleEventSendToGame" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Classes\Particles\ParticleSystemComponent.h	929	42	Claudia
	15	IntelliSense: no instance of constructor "FReadSurfaceDataFlags::FReadSurfaceDataFlags" matches the argument list	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h	55	92	Claudia
	16	IntelliSense: no instance of constructor "FReadSurfaceDataFlags::FReadSurfaceDataFlags" matches the argument list	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h	63	87	Claudia
	17	IntelliSense: identifier "FMeshBatchElement" is undefined	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Engine\Source\Runtime\ShaderCore\Public\VertexFactory.h	488	131	Claudia
	18	IntelliSense: no instance of overloaded function "APickup::APickup" matches the specified type	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Source\Claudia\Private\Pickup.cpp	7	10	Claudia
	19	IntelliSense: expected a '{'	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Source\Claudia\Private\Pickup.cpp	8	2	Claudia
	20	IntelliSense: cannot open source file "Pickup.generated.h"	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Source\Claudia\Public\Pickup.h	4	1	Claudia
	21	IntelliSense: expected an identifier	e:\Unreal Engine Source Code Original\UnrealEngine-4.4\Projects\Claudia\Source\Claudia\Public\Pickup.h	12	2	Claudia


I cannot find ANYTHING ANYWHERE on the issue :confused: Oh, except one fix which is to use the launcher to make the engine. But I have to build it via the github source code. It’s for a uni assessment.

Don’t see anything wrong with that code. Have you tried to actually compile it? May be just confused Intellisense or something.

After you added you new classes you should re-generate the project files, it seams that the ‘Pickup.generated.h’ file is missing.