#include “MyWorldSettings.h”
#include <PhysXPublicCore.h>
class MyContactModifyCallback : public FContactModifyCallback
{
public:
void onContactModify(PxContactModifyPair* const pairs, PxU32 count)
{
UE_LOG(LogTemp, Error, TEXT("bbbbbbbbbbb"))
}
};
class FMyContactModifyCallbackFactory : public IContactModifyCallbackFactory
{
public:
FContactModifyCallback* Create(FPhysScene_PhysX* PhysScene)
{
return new MyContactModifyCallback();
}
void Destroy(FContactModifyCallback* Callback)
{
delete Callback;
}
};
AMyWorldSettings::AMyWorldSettings(const FObjectInitializer& ObjectInitializer)
: AWorldSettings(ObjectInitializer)
{
FPhysScene_PhysX::ContactModifyCallbackFactory = TSharedPtr<IContactModifyCallbackFactory>(new FMyContactModifyCallbackFactory());
}
已启动生成…
1>------ 已跳过生成: 项目: UE4, 配置: BuiltWithUnrealBuildTool Win32 ------
1>没有为此解决方案配置选中要生成的项目
2>------ 已启动生成: 项目: test2, 配置: Development_Editor x64 ------
2>Parsing headers for test2Editor
2> Running UnrealHeaderTool “E:\tan\ue4\test\test2\test2.uproject” “E:\tan\ue4\test\test2\Intermediate\Build\Win64\test2Editor\Development\test2Editor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -abslog=“C:\Users\33201\AppData\Local\UnrealBuildTool\Log_UHT.txt” -installed
2>LogInit: Display: Loading text-based GConfig…
2>Reflection code generated for test2Editor in 2.7094761 seconds
2>Building test2Editor…
2>Using Visual Studio 2019 14.29.30133 toolchain (d:\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133) and Windows 10.0.16299.0 SDK (D:\Windows Kits\10).
2>Building 6 actions with 16 processes…
2> [1/6] test2.init.gen.cpp
2> [2/6] MyWorldSettings.gen.cpp
2> [3/6] MyWorldSettings.cpp
2> [4/6] UE4Editor-test2-0006.lib
2> 正在创建库 E:\tan\ue4\test\test2\Intermediate\Build\Win64\UE4Editor\Development\test2\UE4Editor-test2-0006.lib 和对象 E:\tan\ue4\test\test2\Intermediate\Build\Win64\UE4Editor\Development\test2\UE4Editor-test2-0006.exp
2> [5/6] UE4Editor-test2-0006.dll
2> 正在创建库 E:\tan\ue4\test\test2\Intermediate\Build\Win64\UE4Editor\Development\test2\UE4Editor-test2-0006.suppressed.lib 和对象 E:\tan\ue4\test\test2\Intermediate\Build\Win64\UE4Editor\Development\test2\UE4Editor-test2-0006.suppressed.exp
2>MyWorldSettings.cpp.obj : error LNK2019: 无法解析的外部符号 “__declspec(dllimport) public: virtual __cdecl FContactModifyCallback::~FContactModifyCallback(void)” (_imp??1FContactModifyCallback@@UEAA@XZ),函数 “public: virtual void * __cdecl MyContactModifyCallback::`scalar deleting destructor’(unsigned int)” (??_GMyContactModifyCallback@@UEAAPEAXI@Z) 中引用了该符号
2>MyWorldSettings.cpp.obj : error LNK2019: 无法解析的外部符号 “__declspec(dllimport) public: __cdecl FContactModifyCallback::FContactModifyCallback(void)” (_imp??0FContactModifyCallback@@QEAA@XZ),函数 “public: virtual struct FContactModifyCallback * __cdecl FMyContactModifyCallbackFactory::Create(class FPhysScene_PhysX *)” (?Create@FMyContactModifyCallbackFactory@@UEAAPEAUFContactModifyCallback@@PEAVFPhysScene_PhysX@@@Z) 中引用了该符号
2>E:\tan\ue4\test\test2\Binaries\Win64\UE4Editor-test2-0006.dll : fatal error LNK1120: 2 个无法解析的外部命令
2>d:\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: 命令““D:\Epic Games\UE_4.27\Engine\Build\BatchFiles\Build.bat” test2Editor Win64 Development -Project=“E:\tan\ue4\test\test2\test2.uproject” -WaitMutex -FromMsBuild”已退出,代码为 6。
2>已完成生成项目“test2.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 1 个 ==========