I defined Enum before the GameInctance class and got strange copiling error.
//
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "MainMenuGameInstance.generated.h"
/* ENUM FOR TRAKING GAME STATE */
UENUM(BlueprintType)
enum class EGameState : uint8
{
ENone UMETA(DisplayName = "None"),
ELoadingScreen UMETA(DisplayName = "Loading Screen"),
EStartup UMETA(DisplayName = "Startup"),
EMainMenu UMETA(DisplayName = "Main Menu"),
EMultiplayerHome UMETA(DisplayName = "Multiplayer Home"),
EMultiplayerJoin UMETA(DisplayName = "MultiplayerJoin"),
EMultiplayerHost UMETA(DisplayName = "Multiplayer Host"),
EMultiplayerInGame UMETA(DisplayName = "Multiplayer In Game"),
ETraveling UMETA(DisplayName = "Traveling")
};
/* ENUM TO TRACK INPUT STATES */
UENUM(BlueprintType)
enum class EInputMode : uint8
{
EUIOnly UMETA(DisplayName = "UI Only"),
EUIAndGame UMETA(DisplayName = "UI And Game"),
EGameOnly UMETA(DisplayName = "Game Only")
};
/**
*
*/
UCLASS()
class SVALKER4_API UMainMenuGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UMainMenuGameInstance();
};
the error in MVS2017
and tis is error then compiling from UE4
Warning: Starting HotReload took 0.0s.
CompilerResultsLog: New page: Compilation - Oct 7, 2017, 9:11:52 PM
CompilerResultsLog: Compiling game modules for hot reload
CompilerResultsLog: Parsing headers for SVALKER4Editor
CompilerResultsLog: Running UnrealHeaderTool "E:\Users\Max\Documents\UnrealProjects\SVALKER4\SVALKER4.uproject" "E:\Users\Max\Documents\UnrealProjects\SVALKER4\Intermediate\Build\Win64\SVALKER4Editor\Development\SVALKER4Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
CompilerResultsLog: Reflection code generated for SVALKER4Editor in 10,2784695 seconds
CompilerResultsLog: Performing 4 actions (4 in parallel)
CompilerResultsLog: MainMenuGameInstance.gen.cpp
CompilerResultsLog: MainMenuGameInstance.cpp
CompilerResultsLog: [3/4] Link UE4Editor-SVALKER4-317.dll
CompilerResultsLog: [4/4] Link UE4Editor-SVALKER4-317.lib
CompilerResultsLog: SVALKER4Character.gen.cpp.obj : warning LNK4006: "unsigned int __cdecl Get_Z_Construct_UEnum_SVALKER4_EInputMode_CRC(void)" (?Get_Z_Construct_UEnum_SVALKER4_EInputMode_CRC@@YAIXZ) ??? ????????? ? MainMenuGameInstance.gen.cpp.obj; ?????? ??????????? ?????????
CompilerResultsLog: SVALKER4Character.gen.cpp.obj : warning LNK4006: "class UEnum * __cdecl Z_Construct_UEnum_SVALKER4_EInputMode(void)" (?Z_Construct_UEnum_SVALKER4_EInputMode@@YAPEAVUEnum@@XZ) ??? ????????? ? MainMenuGameInstance.gen.cpp.obj; ?????? ??????????? ?????????
CompilerResultsLog: ????????? ?????????? E:\Users\Max\Documents\UnrealProjects\SVALKER4\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SVALKER4-317.lib ? ?????? E:\Users\Max\Documents\UnrealProjects\SVALKER4\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SVALKER4-317.exp
CompilerResultsLog: Error: SVALKER4Character.gen.cpp.obj : error LNK2005: "unsigned int __cdecl Get_Z_Construct_UEnum_SVALKER4_EInputMode_CRC(void)" (?Get_Z_Construct_UEnum_SVALKER4_EInputMode_CRC@@YAIXZ) ??? ????????? ? MainMenuGameInstance.gen.cpp.obj
CompilerResultsLog: Error: SVALKER4Character.gen.cpp.obj : error LNK2005: "class UEnum * __cdecl Z_Construct_UEnum_SVALKER4_EInputMode(void)" (?Z_Construct_UEnum_SVALKER4_EInputMode@@YAPEAVUEnum@@XZ) ??? ????????? ? MainMenuGameInstance.gen.cpp.obj
CompilerResultsLog: ????????? ?????????? E:\Users\Max\Documents\UnrealProjects\SVALKER4\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SVALKER4-317.suppressed.lib ? ?????? E:\Users\Max\Documents\UnrealProjects\SVALKER4\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SVALKER4-317.suppressed.exp
CompilerResultsLog: Error: MainMenuGameInstance.cpp.obj : error LNK2019: ?????? ?? ????????????? ??????? ?????? "public: __cdecl UMainMenuGameInstance::UMainMenuGameInstance(void)" (??0UMainMenuGameInstance@@QEAA@XZ) ? ??????? "public: static void __cdecl UMainMenuGameInstance::__DefaultConstructor(class FObjectInitializer const &)" (?__DefaultConstructor@UM
ainMenuGameInstance@@SAXAEBVFObjectInitializer@@@Z)
CompilerResultsLog: Error: MainMenuGameInstance.gen.cpp.obj : error LNK2001: ????????????? ??????? ?????? ""public: __cdecl UMainMenuGameInstance::UMainMenuGameInstance(void)" (??0UMainMenuGameInstance@@QEAA@XZ)"
CompilerResultsLog: Error: E:\Users\Max\Documents\UnrealProjects\SVALKER4\Binaries\Win64\UE4Editor-SVALKER4-317.dll : fatal error LNK1120: ????????????? ??????? ?????????: 1
CompilerResultsLog: ERROR: UBT ERROR: Failed to produce item: E:\Users\Max\Documents\UnrealProjects\SVALKER4\Binaries\Win64\UE4Editor-SVALKER4-317.dll
CompilerResultsLog: Total build time: 22,73 seconds (Local executor: 0,00 seconds)
LogMainFrame: MainFrame: Module compiling took 23.314 seconds
Warning: HotReload failed, recompile failed
i have read [this UE4 wiki about enums][2] and can’t find what exactly i am doing wrong. Can you point me in the right direction?