Hi,
i’m trying to get an interface working. I read ramas Tutorial and i also took a look into the StrategyGame example. I created the UInterface by adding UObject with the Wizard and renaming it. But i’m not able to get it working… I looked through the answer hub, but i couldn’t find a solution that’s working for me. This is my code:
SelectionInterface.h
#pragma once
#include "SelectionInterface.generated.h"
UINTERFACE()
class USelectionInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class ISelectionInterface
{
GENERATED_IINTERFACE_BODY()
};
I removed everything, and the error is still there. The .h file is nowhere included, there are only the few lines you see above.
This is the error i get:
1>------ Build started: Project: RTS, Configuration: Development_Editor x64 ------
1> Compiling game modules for hot reload
1> Performing 2 actions (4 in parallel)
1> RTSPlayerController.cpp
1> [2/2] Link UE4Editor-RTS-9077.dll
1> Creating library D:\Unreal Projects\RTS\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-RTS-9077.lib and object D:\Unreal Projects\RTS\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-RTS-9077.exp
**1>RTS.generated.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl USelectionInterface::USelectionInterface(class FObjectInitializer const &)" (??0USelectionInterface@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "void __cdecl InternalConstructor<class USelectionInterface>(class FObjectInitializer const &)" (??$InternalConstructor@VUSelectionInterface@@@@YAXAEBVFObjectInitializer@@@Z)
1>D:\Unreal Projects\RTS\Binaries\Win64\UE4Editor-RTS-9077.dll : fatal error LNK1120: 1 unresolved externals**
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: D:\Unreal Projects\RTS\Binaries\Win64\UE4Editor-RTS-9077.dll
1> Total build time: 3,59 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" RTSEditor Win64 Development "D:\Unreal Projects\RTS\RTS.uproject" -rocket -waitmutex -2015" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The strange thing is: If i don’t change anything in the project and compile it again, the Output log says “Target is up to date” and no errors (but also no update ingame). If i then change any line (doesn’t matter where or what) the error appears again. Compiling again → “Target is up to date”, no error and so on…
Would be cool if someone has got a solution!