I’m trying to use Third Party Library in my plugin for write PDF document and get fatal error in builded game (Windows 64-bit).
In editor all works fine.
library: https://github.com/galkahana/PDF-Writer
Error occurs when call:
PDFUsedFont * font = PdfWriter->GetFontForFile(fontpath, 0L);
this function returns NULL in DebugGame in Local Windows Debugger
In build.cs I’m include all .lib files:
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, ../../Source/PDFWriter4_0/Build/LibAesgm.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/Zlib.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/LibTiff.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/LibJpeg.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/FreeType.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/libpng_64.lib")));
PublicAdditionalLibraries.Add(Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/PDFWriter4_0/Build/PDFWriter.lib")));
In packaged game log I have:
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: === Critical error: ===
[2019.04.05-14.46.17:507][ 43]LogWindows: Error:
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: Fatal error!
[2019.04.05-14.46.17:507][ 43]LogWindows: Error:
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000
[2019.04.05-14.46.17:507][ 43]LogWindows: Error:
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: [Callstack] 0x00007ff76cd661d0 pdfWriterPlugin.exe!UnknownFunction []
...
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: [Callstack] 0x00007ff9fb34b85d USER32.dll!UnknownFunction []
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: [Callstack] 0x00007ff9fb34b1ef USER32.dll!UnknownFunction []
[2019.04.05-14.46.17:507][ 43]LogWindows: Error: [Callstack] 0x00007ff769baef76 pdfWriterPlugin.exe!UnknownFunction []
...
[2019.04.05-14.46.17:508][ 43]LogWindows: Error: [Callstack] 0x00007ff9f9a81fe4 KERNEL32.DLL!UnknownFunction []
[2019.04.05-14.46.17:508][ 43]LogWindows: Error: [Callstack] 0x00007ff9fc0ff061 ntdll.dll!UnknownFunction []
[2019.04.05-14.46.17:508][ 43]LogWindows: Error:
I think that UE4 have some troubles with FreeType.lib, in VS it has no intellisense highlight.
I’m already has try to:
- Add .h files from FreeType.lib to source/PDFWriter4_0/FreeType/include and add this path to “PublicIncludePaths” and/or ''PrivateIncludePaths" in my build.cs file
- Use Engine FreeType2 Library from Epic Games\UE_4.22\Engine\Source\ThirdParty\FreeType2
- Use FreeType 2.6.0 (as in editor Runtime) instead FreeType 2.4.11 in shipping build (change FreeType.Build.cs in Engine\Source\ThirdParty\FreeType2) - this don’t help (LogSlate: Using FreeType 2.4.11)
Sorry for my English