Hi.
I’m implemented AI in Blueprints. I want convert in C++.
Created is empty class inherited of UBTService_BlackboardBase.
MyBTService_BlackboardBase.h
#pragma once
#include "CoreMinimal.h"
#include "BehaviorTree/Services/BTService_BlackboardBase.h"
#include "MyBTService_BlackboardBase.generated.h"
UCLASS()
class MYPROJECT_API UMyBTService_BlackboardBase : public UBTService_BlackboardBase
{
GENERATED_BODY()
};
MyBTService_BlackboardBase.cpp
#include "MyBTService_BlackboardBase.h"
Added “AIModule” module.
MyProject.Build.cs
...
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AIModule" });
...
Error:
1> UE4Editor-MyProject.dll 1>
Creating library
…\MyProject\Intermediate\Build\Win64\UE4Editor\Development\MyProject\UE4Editor-MyProject.suppressed.lib
and object
…\MyProject\Intermediate\Build\Win64\UE4Editor\Development\MyProject\UE4Editor-MyProject.suppressed.exp
1>MyBTService_BlackboardBase.cpp.obj :
error LNK2001: unresolved external
symbol “public: virtual void __cdecl
IGameplayTaskOwnerInterface::OnGameplayTaskActivated(class
UGameplayTask &)”
(?OnGameplayTaskActivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z)
1>MyBTService_BlackboardBase.gen.cpp.obj
: error LNK2001: unresolved external
symbol “public: virtual void __cdecl
IGameplayTaskOwnerInterface::OnGameplayTaskActivated(class
UGameplayTask &)”
(?OnGameplayTaskActivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z)
1>MyBTService_BlackboardBase.cpp.obj :
error LNK2001: unresolved external
symbol “public: virtual void __cdecl
IGameplayTaskOwnerInterface::OnGameplayTaskDeactivated(class
UGameplayTask &)”
(?OnGameplayTaskDeactivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z)
1>MyBTService_BlackboardBase.gen.cpp.obj
: error LNK2001: unresolved external
symbol “public: virtual void __cdecl
IGameplayTaskOwnerInterface::OnGameplayTaskDeactivated(class
UGameplayTask &)”
(?OnGameplayTaskDeactivated@IGameplayTaskOwnerInterface@@UEAAXAEAVUGameplayTask@@@Z)
1>…\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
: fatal error LNK1120: 2 unresolved
externals 1>UnrealBuildTool : error :
UBT ERROR: Failed to produce item:
…\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
1> (see
…/Programs/UnrealBuildTool/Log.txt
for full exception trace) 1>Total
build time: 3,89 seconds (Parallel
executor: 0,00 seconds) 1>C:\Program
Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5):
error MSB3075: The command
““C:\Program Files\Epic
Games\UE_4.20\Engine\Build\BatchFiles\Build.bat”
MyProjectEditor Win64 Development
“…\MyProject\MyProject.uproject”
-WaitMutex -FromMsBuild” exited with code 5. Please verify that you have
sufficient rights to run this command.
1>Done building project
“MyProject.vcxproj” – FAILED.
Where/What is the problem?