// Fill out your copyright notice in the Description page of Project Settings.
#include “SKGameModeBase.h”
#include “../../ThirdParty/include/HookDirectX.h”
#include “Engine/GameViewportClient.h”
#include “Widgets/SWindow.h”
void ASKGameModeBase::BeginPlay()
{
void* h = GEngine->GameViewport->GetWindow()->GetNativeWindow()->GetOSWindowHandle();
FString fxPath = FPaths::Combine(FPaths::ProjectConfigDir(), TEXT(“rend2d. fx”));
FString mapData = FPaths::Combine(FPaths::ProjectConfigDir(), TEXT(“config. dat”));
if (FPaths::FileExists(fxPath) && FPaths::FileExists(mapData))
{
wchar_t* strFx = fxPath.GetCharArray().GetData();
wchar_t* strData = mapData.GetCharArray().GetData();
ImplHookDX11_Init(h, strFx, strData);
}
Super::BeginPlay();
}
void ASKGameModeBase::EndPlay(const EEndPlayReason :: Type EndPlayReason)
{
ImplHookDX11_Shutdown();
Super::EndPlay(EndPlayReason);
}
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2019 无法解析的外部符号 “__declspec(dllimport) public: class TSharedPtr<class FGenericWindow,0> cdecl SWindow::GetNativeWindow(void)” (imp_?GetNativeWindow@SWindow@@QEAA?AV?$TSharedPtr@VFGenericWindow@@$0A@@@XZ),函数 “public: virtual void __cdecl ASKGameModeBase::BeginPlay(void)” (?BeginPlay@ASKGameModeBase@@UEAAXXZ) 中引用了该符号 jingsu D:\jingsu\Intermediate\ProjectFiles\SKGameModeBase.cpp.obj 1
报错显示无法解析GetNativeWindow()但调的库都调用了