Integrating OpenCV 4 with Unreal 4.20+ with VS2017

Hi,

I tried following the guidelines as per A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

It works fine for the same versions as mentioned in post i.e. UE4.17, VS2017, OpenCV3.2 but I need Unreal 4.20+ for my work and having a hard time integrating it as the above guidelines give errors specifically in the portion when I try:
“Right-click your project on your solution explorer, click Debug - Start new instance. Now, your project should successfully compile with OpenCV included within the engine build! However, there is one more thing that needs to be included before you can use OpenCV’s function inside your UE4 editor.”

The error is as under:
Error CS1729 ‘UnrealBuildTool.ModuleRules’ does not contain a constructor that takes 0 arguments
Error CS0122 ‘UnrealBuildTool.BuildConfiguration’ is inaccessible due to its protection level

Is anyone facing the same issue? Need help in solving this. Thanks in advance.

Hi,

In your [ProjectName].Build.cs, Change constructor

from
public [ProjectName](TargetInfo Target)

to
public [ProjectName](ReadOnlyTargetRules Target) : base(Target)

and also replace “BuildConfiguration” with “Target”