LNK1120 and LNK 2019 UE4Editor-Project.dll

Hello all,

So, I am just getting started in UE4 programming, and I was trying to make my own game mode and player controller class for my UE4 Project, and after a little bit of coding I have hit a major snag and don’t really know what the problem is. I keep getting the following linker errors

Error	1	
error LNK2019: unresolved external symbol "public: virtual void __cdecl AMonkeyNutsGameMode::StartMatch(void)" (?StartMatch@AMonkeyNutsGameMode@@UEAAXXZ) referenced in function "public: __cdecl AMonkeyNutsGameMode::AMonkeyNutsGameMode(class FPostConstructInitializeProperties const &)" (??0AMonkeyNutsGameMode@@QEAA@AEBVFPostConstructInitializeProperties@@@Z)	C:\Users\ \Documents\Unreal Projects\MonkeyNuts\Intermediate\ProjectFiles\MonkeyNutsGameMode.cpp.obj	MonkeyNuts

Error	2	error LNK1120: 1 unresolved externals	C:\Users\ \Documents\Unreal Projects\MonkeyNuts\Binaries\Win64\UE4Editor-MonkeyNuts.dll	1	1	MonkeyNuts

My code is included below. I understand that something is off with the linker, but not really sure what I’m doing wrong. Additionally, now the editor will no longer allow me to load my project in editor, it crashes with the following message:


Access violation - code c0000005 (first/second chance not available)

Fatal error!

UE4Editor_Engine + 9049160 bytes
UE4Editor_Engine + 2395910 bytes
UE4Editor_CoreUObject + 1001061 bytes
UE4Editor_CoreUObject + 1170269 bytes
UE4Editor_CoreUObject + 731562 bytes
UE4Editor!TBaseMulticastDelegate_NoParams<void>::Broadcast() + 128 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:1852]
UE4Editor!FEngineLoop::AppPreExit() + 353 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\launchengineloop.cpp:2529]
UE4Editor!FEngineLoop::Exit() + 278 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\launchengineloop.cpp:1944]
UE4Editor!GuardedMain() + 529 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\launch.cpp:144]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.3\engine\source\runtime\launch\private\windows\launchwindows.cpp:207]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Appreciate any help. Including my code below.


//Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "MonkeyNuts.h"
#include "MonkeyNutsGameMode.h"
#include "MonkeyNutsHUD.h"

AMonkeyNutsGameMode::AMonkeyNutsGameMode(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
	// set default pawn class to our Blueprinted character
	static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Blueprints/MyCharacter"));
	DefaultPawnClass = PlayerPawnClassFinder.Class;

	// use our custom HUD class
	HUDClass = AMonkeyNutsHUD::StaticClass();

		//GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("It worked");



// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "MonkeyNutsGameMode.generated.h"

class AMonkeyNutsGameMode : public AGameMode
	virtual void StartMatch() override;


EDIT: Just in case someone needs to know, I am running Unreal Version 4.3.1 and running everything as 64-bit with a 64-bit Win 8.1 OS

You need to provide a body to the StartMatch function. You declared it in the header, but your C++ doesn’t provide an implementation

i have same 2 errors but with my code ofc :x also no answer as well :confused:

I think you need to add the appropriate API macro for your module:

class MonkeyNuts_API AMonkeyNutsGameMode : public AGameMode

If you don’t know what macro to use, check the generated code (Add New > C++ class).