UE4加载第三方lib warning解决

WARNING: Library 'VideoRecorder.lib' was not resolvable to a file when used in Module 'VideoRecorder', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning.

在UE4.24开始的版本PublicAdditionalLibraries传入lib库的完整路径可以修复此warning,或者将PublicLibraryPaths.Add替换为PublicSystemLibraryPaths.Add得到解决。

// PublicLibraryPaths.Add(Path.Combine(LibraryPath, "lib", "x64", "Release"));
           // PublicAdditionalLibraries.Add("VideoRecorder.lib");
           //4.24后这里需要使用全路径,否则会报warning,当然也可以将PublicLibraryPaths.Add(Path.Combine(LibraryPath, "lib", "x64", "Release"))修改为PublicSystemLibraryPaths.Add(Path.Combine(LibraryPath, "lib", "x64", "Release"))得到解决
            PublicAdditionalLibraries.Add(Path.Combine(Path.GetFullPath(
                  Path.Combine(ModuleDirectory, "../../ThirdParty/VideoRecorder")
            ), "lib", "x64", "Release","VideoRecorder.lib"));

你可能感兴趣的:(UE4,ue4)