Hello, first I have to excuse myself because I don’t know that much about C++ but in my day job I am a Java-Developer, so I am not that foreign to programming concepts.
I am nearly finished with a project I am working on at the moment, but I need one more function and that is to get CPU and GPU information shown in a widget.
And it happens to be the first thing I need C++ for in my project.
I found this thread and tried to follow it. First of course I installed Visual Studio for the Unreal Engine etc.
Then I created a new function library class with the name “PlatformFunctions”.
After that I had two new files in the MyProject_Name\Source\MyProject_Name folder.
Here I added
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "PlatformFunctions.generated.h"
/**
*
*/
UCLASS()
class YOURPROJECTNAME_API UPlatformFunctions : public UBlueprintFunctionLibrary //add your project name
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get CPU Brand Name", Keywords = "CPU brand"), Category = Game) //Set your category
static FString GetCPUBrandName();
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get CPU Vendor Name", Keywords = "CPU vendor"), Category = Game)
static FString GetCPUVendorName();
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get GPU Brand Name", Keywords = "GPU brand"), Category = Game)
static FString GetGPUBrandName();
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Number of CPU Cores", Keywords = "CPU cores"), Category = Game)
static int32 GetCPUCores();
};
into the PlatformFunctions.h file and
#include "ProjectName.h" //add your project name
#include "PlatformFunctions.h"
FString UPlatformFunctions::GetCPUBrandName()
{
return FWindowsPlatformMisc::GetCPUBrand();
}
FString UPlatformFunctions::GetCPUVendorName()
{
return FWindowsPlatformMisc::GetCPUVendor();
}
FString UPlatformFunctions::GetGPUBrandName()
{
return FWindowsPlatformMisc::GetPrimaryGPUBrand();
}
int32 UPlatformFunctions::GetCPUCores()
{
return FWindowsPlatformMisc::NumberOfCores();
}
into the PlatformFunctions.cpp file.
Now I tried to compile it via the compile button in the Unreal Engine but I’ve got many errors.
Next I guessed that I have to replace
#include "ProjectName.h" //add your project name
with my actual project name. So I did it:
#include "MyProject_Name.h" //add your project name
Next I replaced:
class YOURPROJECTNAME_API UPlatformFunctions : public UBlueprintFunctionLibrary //add your project name
with
class MyProject_Name_API UPlatformFunctions : public UBlueprintFunctionLibrary //add your project name
in the PlatformFunctions.h file.
But I still cannot compile it, I get the following ERRORS:
Using 'git status' to determine working set for adaptive non-unity build (E:\Unreal_Engine\MyProject_Name).
Building MyProject_NameEditor...
Using Visual Studio 2019 14.28.29913 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 5 actions with 16 processes...
[1/5] PlatformFunctions.cpp
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(10) : error C2079: 'UPlatformFunctions' uses undefined class 'MyProject_Name_API'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(10) : error C2143: syntax error: missing ';' before ':'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(10) : error C2059: syntax error: ':'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(10) : error C2059: syntax error: 'public'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(11) : error C2143: syntax error: missing ';' before '{'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.h(11) : error C2447: '{': missing function header (old-style formal list?)
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.cpp(5) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.cpp(10) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.cpp(15) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name\PlatformFunctions.cpp(20) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
[2/5] PlatformFunctions.gen.cpp
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10) : error C2079: 'UPlatformFunctions' uses undefined class 'MyProject_Name_API'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10) : error C2143: syntax error: missing ';' before ':'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10) : error C2059: syntax error: ':'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10) : error C2059: syntax error: 'public'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(11) : error C2143: syntax error: missing ';' before '{'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(11) : error C2447: '{': missing function header (old-style formal list?)
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(21) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(25) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(25) : error C3861: 'GetCPUCores': identifier not found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(28) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(32) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(32) : error C3861: 'GetGPUBrandName': identifier not found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(35) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(39) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(39) : error C3861: 'GetCPUVendorName': identifier not found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(42) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(46) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(46) : error C3861: 'GetCPUBrandName': identifier not found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(49) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(51) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(51) : error C2672: 'StaticClass': no matching overloaded function found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(51) : error C2783: 'UClass *StaticClass(void)': could not deduce template argument for 'ClassType'
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/ReflectedTypeAccessors.h(13): note: see declaration of 'StaticClass'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(53) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(54) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(55) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(56) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(204) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(204) : error C2672: 'StaticClass': no matching overloaded function found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(204) : error C2783: 'UClass *StaticClass(void)': could not deduce template argument for 'ClassType'
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/ReflectedTypeAccessors.h(13): note: see declaration of 'StaticClass'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(234) : error C2923: 'TCppClassTypeTraits': 'UPlatformFunctions' is not a valid template type argument for parameter 'CPPCLASS'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(234) : error C2955: 'TCppClassTypeTraits': use of class template requires template argument list
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/Class.h(2453): note: see declaration of 'TCppClassTypeTraits'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(234) : error C4800: Implicit conversion from 'TCppClassTypeTraits<CPPCLASS>::<unnamed-enum-IsAbstract>' to bool. Possible information loss
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(235): note: consider using explicit cast or comparison to 0 to avoid this warning
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/Class.h(2456): note: see declaration of 'TCppClassTypeTraits<CPPCLASS>::<unnamed-enum-IsAbstract>'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(235): warning C4305: 'initializing': truncation from 'TCppClassTypeTraits<CPPCLASS>::<unnamed-enum-IsAbstract>' to 'bool'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(237) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(237) : error C2440: 'initializing': cannot convert from 'overloaded-function' to 'UClass *(__cdecl *)(void)'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(237): note: None of the functions with this name in scope match the target type
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C2923: 'TClassCompiledInDefer': 'UPlatformFunctions' is not a valid template type argument for parameter 'TClass'
E:\Unreal_Engine\MyProject_Name\Source\MyProject_Name/PlatformFunctions.h(10): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C2514: 'TClassCompiledInDefer': class template cannot be constructed
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/UObjectBase.h(291): note: see declaration of 'TClassCompiledInDefer'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C3861: 'StaticPackage': identifier not found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C2065: 'StaticClassFlags': undeclared identifier
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(260) : error C2061: syntax error: identifier 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(262) : error C2912: explicit specialization 'UClass *StaticClass<UPlatformFunctions>(void)' is not a specialization of a function template
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(263) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(263) : error C2672: 'StaticClass': no matching overloaded function found
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(263) : error C2783: 'UClass *StaticClass(void)': could not deduce template argument for 'ClassType'
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/ReflectedTypeAccessors.h(13): note: see declaration of 'StaticClass'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(265) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(265) : error C2664: 'FCompiledInDefer::FCompiledInDefer(UClass *(__cdecl *)(void),UClass *(__cdecl *)(void),const TCHAR *,const TCHAR *,bool,const TCHAR *,const TCHAR *,void (__cdecl *)(TMap<FName,FName,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<KeyType,ValueType,false>> &))': cannot convert argument 2 from 'UClass *(__cdecl *)(void)' to 'UClass *(__cdecl *)(void)'
with
KeyType=FName,
ValueType=FName
]
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(265): note: None of the functions with this name in scope match the target type
E:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/UObjectBase.h(316): note: see declaration of 'FCompiledInDefer::FCompiledInDefer'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(266) : error C2027: use of undefined type 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.generated.h(103): note: see declaration of 'UPlatformFunctions'
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(266) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(266) : error C2550: '{ctor}': constructor initializer lists are only allowed on constructor definitions
E:\Unreal_Engine\MyProject_Name\Intermediate\Build\Win64\UE4Editor\Inc\MyProject_Name\PlatformFunctions.gen.cpp(266) : error C4508: '{ctor}': function should return a value; 'void' return type assumed
To give you as much information as possible, if you need it, here are my two C++ files:
I would be very grateful for any help!