Download

I just did Inheritance with some template.... and....

209e2dd3ef8bf8f68e1d9cb3fcf8ec052a93d828.png

I just inherited from the class, which already inherited AHUD.

I think Complier saying “I cannot find your custom parent class”…

I didn’t even touch public the parentclass either…

here is the code




#pragma once

#include "NCFT_HUD.h"
#include "NCFT_NonBattleUIManager.generated.h"

/**
 * 
 */
UCLASS()
class NOCOUNTRYFORTHEM_API ANCFT_NonBattleUIManager : public ANCFT_HUD
{
	GENERATED_BODY()
public:
	ANCFT_NonBattleUIManager(const FObjectInitializer& ObjectInitializer);

	template<typename theType>
	theType GetTheClassType(EWidgetTypesEnum type)
	{

		theType data;
		switch (type)
		{
		case EWidgetTypesEnum::WT_NONBATTLEMENU:
			data = NewObject<UNonBattleMenu>();
			break;
		case EWidgetTypesEnum::WT_CHARACTER:
			break;
		case EWidgetTypesEnum::WT_ITEM:
			break;
		case EWidgetTypesEnum::WT_CRAFT:
			break;
		case EWidgetTypesEnum::WT_OPTIONEXIT:
			break;
		default:
			break;
		}
		return data;
	}

};


anything is okay… but with inheritance? I am being clueless… even though it is my first time to inherit from Custom Class.

but I know basic of inheritance… what could be wrong?

why my complier keep saying weird message with “Super”… What does it have to do with it???

Maybe I gonna try Interface… but that pesky code even cannot be deleted… my God…

The problem is likely elsewhere, such as in NCFT_NonBattleUIManager.h referencing some symbol that is not defined, thus missing some include.

Also, try switching your locale to English so that we can read the actual error messages – the font in the console doesn’t even support the character set used by your locale right now.

Oh… my bad. thanks for correction. I gonna set my locale right now.

I changed my locale to English… and still that weird error message… still clueless

You may have to re-install Visual Studio with English language for that to work :frowning:
Alternatively, if you can open the build log in another editor, it may use a font that supports the script, and you can read the error
Or you can look up each of the error messages by code on MSDN.
C2504 is “base class undefined.”

Thanks. After changing locale, i did reinstall VS 2015 and it shows properly error message in English. But… I have no idea why my base class cause trouble… here is code just in case




#pragma once

#include "GameFramework/HUD.h"
#include "EnumHeader.h"
#include "BattleHudPlayerController.h"
#include "Default_Widget.h"
#include "NonBattleMenu.h"
#include "CharacterStatus.h"
#include "NCFT_HUD.generated.h"

/**
 * 
 */
UCLASS()
class NOCOUNTRYFORTHEM_API ANCFT_HUD : public AHUD
{
	GENERATED_BODY()
public:
	ANCFT_HUD(const FObjectInitializer& ObjectInitializer);
	//Data
	TMap<EWidgetTypesEnum, class UDefault_Widget*> WidgetMap;
	class UDefault_Widget* GetTheWidget(const EWidgetTypesEnum type);
	//virtual void CreateWidget(EWidgetTypesEnum type, APlayerController* currentController) PURE_VIRTUAL(ANCFT_HUD::CreateWidget, ;);
	void CreateNewWidget(EWidgetTypesEnum type, class APlayerController* currentController);
	template<typename theType>
	theType* GetTheClassType(EWidgetTypesEnum type) PURE_VIRTUAL(ANCFT::GetTheClassType, return NULL;);
};


it just got worse. I just did Generate Visual Studio Files… and I cannot open it in Launcher… What have I done… I even tried to delete Binary folder and generate it again… still same. I forgot to do source control either.

i think my project got corrupted… bummer…

I guess I got carried away…

Should I make new project with copying whole code (import)?

I think I screwed up big this time.

i got weird message even with new project…

The project could not be compiled. Would you like to open it in Visual Studio?

Running D:/UnrealEngine/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe test Development Win64 -project=“D:/NoCountryForThem/Programming/Unreal/Test/test/test.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE
ERROR: Couldn’t find target rules file for target ‘-project=D:/NoCountryForThem/Programming/Unreal/Test/test/test.uproject’ in rules assembly ‘UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’.
Location: D:\UnrealEngine\Epic Games\4.12\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
Target rules found:
UE4Editor - D:\UnrealEngine\Epic Games\4.12\Engine\Source\UE4Editor.Target.cs
UE4Game - D:\UnrealEngine\Epic Games\4.12\Engine\Source\UE4Game.Target.cs
UnrealHeaderTool - D:\UnrealEngine\Epic Games\4.12\Engine\Source\Programs\UnrealHeaderTool\UnrealHeaderTool.Target.cs

and yeah… I tried to reinstall the engine and still getting same error…

cannot open the project… but can make new project…

I guess I learned my lesson. don’t be lazy about source control