UE5使用opencv库要在系统中添加opencv的环境变量
在项目文件夹下新建ThirdParty,将OpenCV中的bin、opencv文件夹copy到ThirdParty中
打开项目,找到source目录下的build.cs文件
修改build.cs内容,添加头文件路径,dll路径,lib路径
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
public class newopencv : ModuleRules
{
private string ModulePath
{
get
{
return ModuleDirectory;
}
}
private string ThirPartyPath
{
get
{
return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/"));
}
}
public bool loado