Hey guys, I’m getting these errors and I cannot figure out for the life of me why.
1>LINK : error LNK2001: unresolved external symbol IMPLEMENT_MODULE_ExperienceAPI
1>xAPIAgentComponent.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FJsonObject::SetStringField(class FString const &,class FString const &)" (__imp_?SetStringField@FJsonObject@@QEAAXAEBVFString@@0@Z) referenced in function "public: class TSharedPtr<class FJsonObject,0> const __cdecl UxAPIAgentComponent::toAgent(void)const " (?toAgent@UxAPIAgentComponent@@QEBA?BV?$TSharedPtr@VFJsonObject@@$0A@@@XZ)
1>xAPIAgentComponent.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl FJsonObject::SetObjectField(class FString const &,class TSharedPtr<class FJsonObject,0> const &)" (__imp_?SetObjectField@FJsonObject@@QEAAXAEBVFString@@AEBV?$TSharedPtr@VFJsonObject@@$0A@@@@Z) referenced in function "public: class TSharedPtr<class FJsonObject,0> const __cdecl UxAPIAgentComponent::toAgent(void)const " (?toAgent@UxAPIAgentComponent@@QEBA?BV?$TSharedPtr@VFJsonObject@@$0A@@@XZ)
1>xAPIAgentComponent.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonObject::FJsonObject(void)" (__imp_??0FJsonObject@@QEAA@XZ) referenced in function "public: class TSharedPtr<class FJsonObject,0> const __cdecl UxAPIAgentComponent::toAgent(void)const " (?toAgent@UxAPIAgentComponent@@QEBA?BV?$TSharedPtr@VFJsonObject@@$0A@@@XZ)
1>xAPIAgentComponent.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FJsonObject::~FJsonObject(void)" (__imp_??1FJsonObject@@QEAA@XZ) referenced in function "public: virtual void __cdecl SharedPointerInternals::TReferenceControllerWithDeleter<class FJsonObject,struct SharedPointerInternals::DefaultDeleter<class FJsonObject> >::DestroyObject(void)" (?DestroyObject@?$TReferenceControllerWithDeleter@VFJsonObject@@U?$DefaultDeleter@VFJsonObject@@@SharedPointerInternals@@@SharedPointerInternals@@UEAAXXZ)
1>F:\UnrealEngine-release\Engine\Plugins\ExperienceAPI\Binaries\Win64\UE4Editor-ExperienceAPI.dll : fatal error LNK1120: 5 unresolved externals
This is my ExperienceAPI.Build.cs
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
namespace UnrealBuildTool.Rules
{
public class ExperienceAPI : ModuleRules
{
public ExperienceAPI(ReadOnlyTargetRules Target) : base(Target)
{
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
}
Heres the xAPIAgentComponent.h
#pragma once
#include "Components/ActorComponent.h"
#include "Json.h"
#include "xAPIAgentComponent.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(LogXapi, Log, All);
UENUM(BlueprintType)
enum class EAgentIFIType : uint8
{
MBOX UMETA(DisplayName = "mbox"),
MBOX_SHA1SUM UMETA(DisplayName = "mbox_sha1sum"),
OPENID UMETA(DisplayName = "openid"),
ACCOUNT UMETA(DisplayName = "account")
};
USTRUCT(BlueprintType)
struct FAgentAccountInfo
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ExperienceAPI)
FString Homepage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ExperienceAPI)
FString Name;
};
/*
* A component representing an xAPI Agent, i.e. a learner
*/
UCLASS(BlueprintType, meta = (BlueprintSpawnableComponent))
class EXPERIENCEAPI_API UxAPIAgentComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
FString Name;
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
EAgentIFIType ifi_type;
//TEnumAsByte<EAgentIFIType::Type> ifi_type;
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
FString Mbox;
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
FString MboxSha1Sum;
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
FString OpenID;
UPROPERTY(EditAnywhere, Category = ExperienceAPI)
FAgentAccountInfo Account;
UxAPIAgentComponent();
const TSharedPtr<FJsonObject> toAgent() const;
};
xAPIAgentComponent.cpp
#include "xAPIAgentComponent.h"
DEFINE_LOG_CATEGORY(LogXapi);
UxAPIAgentComponent::UxAPIAgentComponent()
{
}
const TSharedPtr<FJsonObject> UxAPIAgentComponent::toAgent() const
{
// initialize the object we'll be returning
TSharedPtr<FJsonObject> agent(new FJsonObject());
// specify that the return object is an Agent
agent->SetStringField(TEXT("objectType"), TEXT("Agent"));
// add the general-purpose name if specified
if (!Name.IsEmpty()){
agent->SetStringField(TEXT("name"), Name);
}
// add the IFI specified by ifi_type
switch (ifi_type){
case EAgentIFIType::MBOX:
agent->SetStringField(TEXT("mbox"), Mbox);
break;
case EAgentIFIType::MBOX_SHA1SUM:
agent->SetStringField(TEXT("mbox_sha1sum"), MboxSha1Sum);
break;
case EAgentIFIType::OPENID:
agent->SetStringField(TEXT("openid"), OpenID);
break;
case EAgentIFIType::ACCOUNT:
TSharedPtr<FJsonObject> accountObj(new FJsonObject());
accountObj->SetStringField(TEXT("homePage"), Account.Homepage);
accountObj->SetStringField(TEXT("name"), Account.Name);
agent->SetObjectField(TEXT("account"), accountObj);
break;
}
return agent;
}
Any help would be greatly appriciated!!!