Build errors?

Hello,

So I followed the FPS Tutorials steps, but when I try to build the first time, with only they debug message I get errors. I have no idea why it won’t work.

This is the error I’m getting:

1>------ Build started: Project: FPSProject, Configuration: Development_Editor x64 ------
1> Parsing headers for FPSProjectEditor
1> Code generation finished for FPSProjectEditor and took 2,799
1> rc.exe FPSProject.rc
1> PCH.FPSProject.FPSProject.h.cpp
1> FPSGameMode.cpp
1> FPSProject.cpp
1> link.exe UE4Editor-FPSProject.dll
1> Creating library D:\Projects\Games\UE4\FPSProject\Intermediate\Buil d\Win64\FPSProjectEditor\Development\UE4Editor-FPSProject.lib and object D:\Projects\Games\UE4\FPSProject\Intermediate\Buil d\Win64\FPSProjectEditor\Development\UE4Editor-FPSProject.exp
1>FPSGameMode.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl AFPSGameMode::BeginPlay(void)” (?BeginPlay@AFPSGameMode@@UEAAXXZ)
1>D:\Projects\Games\UE4\FPSProject\Binaries\Win64\ UE4Editor-FPSProject.dll : fatal error LNK1120: 1 unresolved externals
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: D:\Projects\Games\UE4\FPSProject\Binaries\Win64\UE 4Editor-FPSProject.dll
1> Cumulative action seconds (8 processors): 0,00 building projects, 26,47 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,38 linking, 0,00 other
1> UBT execution time: 33,45 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Ma keFile.Targets(38,5): error MSB3073: The command “C:\C_Software\Game_Engines\Unreal_Engine_4\4.0\En gine\Build\BatchFiles\Build.bat FPSProjectEditor Win64 Development “D:\Projects\Games\UE4\FPSProject\FPSProject.uproj ect” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So two questions.

  1. Is there a DLL I need to move from somewhere, or is there something else that is wrong?

  2. My Visual Studio 2013 Express gives me no suggestions for anything. Not even when using the pointer “GEngine”. Do I need to set up Visual Studio differently? I followed the guide to set up Visual Studio as well, but still nothing of that works.

Thanks in advance.

Does anyone know the answer to this? Or has anyone else had the same problem?

It looks like you haven’t defined the BeginPlay() function correctly in FPSGameMode.cpp.

From what I can see looking at the tutorial, your body should look like this

AFPSGameMode::AFPSGameMode(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	
}

void AFPSGameMode::BeginPlay()
{
	Super::BeginPlay();

	if (GEngine)
	{
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("HELLO WORLD"));
	}

}

See if your code matches. It’s possible you’ve defined the BeginPlay() function inside the class constructor.

I had same problem and this answer actually solved it!..thanks

Thanks. That seem to have been the problem. :slight_smile:

The actual error is triggered by missing a .dll, can someone explain why exactly this bad code causes the .dll to be missing/not generated? Please and thanks for the noobies out here.