Hi everyone. I’m a bit new to programming in UE4. I’m working on a project which involves the use of OpenCV on Android platforms. This is the problem: I created a module on Engine/Source/ThirdParty for OpenCV and I have created the OpenCV.Build.cs file, like on the other thirdparty modules, as this:
string SdkBase = UEBuildConfiguration.UEThirdPartySourceDirectory + "OpenCV";
if (!Directory.Exists(SdkBase))
{
string Err = string.Format("OpenCV SDK not found in {0}", SdkBase);
System.Console.WriteLine(Err);
throw new BuildException(Err);
}
if (Target.Platform == UnrealTargetPlatform.Android) {
PublicIncludePaths.Add(SdkBase + "/Android/sdk/native/jni/include");
string LibraryPath = SdkBase + "/Android/sdk/native/libs";
PublicLibraryPaths.Add(LibraryPath + "/armeabi-v7a");
PublicAdditionalLibraries.Add("libopencv_calib3d.a");
PublicAdditionalLibraries.Add("libopencv_core.a");
PublicAdditionalLibraries.Add("libopencv_features2d.a");
PublicAdditionalLibraries.Add("libopencv_flann.a");
PublicAdditionalLibraries.Add("libopencv_highgui.a");
PublicAdditionalLibraries.Add("libopencv_imgcodecs.a");
PublicAdditionalLibraries.Add("libopencv_imgproc.a");
PublicAdditionalLibraries.Add("libopencv_ml.a");
PublicAdditionalLibraries.Add("libopencv_objdetect.a");
PublicAdditionalLibraries.Add("libopencv_photo.a");
PublicAdditionalLibraries.Add("libopencv_shape.a");
PublicAdditionalLibraries.Add("libopencv_stiching.a");
PublicAdditionalLibraries.Add("libopencv_superres.a");
PublicAdditionalLibraries.Add("libopencv_video.a");
PublicAdditionalLibraries.Add("libopencv_videoio.a");
PublicAdditionalLibraries.Add("libopencv_videostab.a");
isLibrarySupperted = true;
//Add the runtime dependency. ie: RuntimeDependencies.Add(new RuntimeDependency(OpenVRBinariesDir + "libopenvr_api.dylib"));
RuntimeDependencies.Add(new RuntimeDependency(LibraryPath + "/armeabi-v7a/libopencv_java3.so"));
and when I try to import some of the .hpp available in the Android/sdk/native/jni/include on my project it returns me an error during compilation. Please, there is someone who can tell me what I am doing wrong?
Thank You