UE4.21+VS2017配置OpenCV-Plugin

1.在建立c++文件后导入插件 https://github.com/Brandon-Wilson/OpenCV-Plugin,记得导入Binaries和ThirdParty文件;
2.修改opencv.build.cs文件如下:

using UnrealBuildTool;
using System.IO;

public class OpenCV : ModuleRules
{
    private string ThirdPartyPath
    {
        get { return Path.GetFullPath(Path.Combine(ModuleDirectory, "../../../../ThirdParty/")); }
    }

    public OpenCV(ReadOnlyTargetRules Target) : base(Target)
    {
        //20191015 BY:Ning+
        PrivatePCHHeaderFile = "Private/OpenCVPrivatePCH.h";

        // Startard Module Dependencies
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "RHI", "RenderCore" });
        PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Slate", "SlateCore" });

        // Start OpenCV linking here!
        bool isLibrarySupported = false;

        // Create OpenCV Path 
        string OpenCVPath = Path.Combine(ThirdPartyPath, "OpenCV");

        // Get Librar

你可能感兴趣的:(C/C++,UE4)