www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - failed loading freetype 2.6 via derelict-ft

reply Spacen <spacenjasst yahoo.co.uk> writes:
Hello,

I am trying to resurect an old project, but can't get the 
freetype library loaded. I can't figgure out what to do it's been 
a while. I have just built the freetype 2.6 library with visual 
studio 2015. Any tips would be appreciated.

dub build
Performing "debug" build using dmd for x86. derelict-util 2.0.6: target for configuration "library" is up to date. derelict-ft 1.1.3: building configuration "library"... derelict-gl3 1.0.23: target for configuration "library" is up to date. derelict-sdl2 1.9.7: target for configuration "library" is up to date. gltest ~master: building configuration "application"... Linking... To force a rebuild of up-to-date targets, run again with --force. C:\>gltest.exe Exception: Failed to load symbol FT_Stream_OpenBzip2 from shared library freetype.dll
Sep 13 2017
next sibling parent reply Igor <stojkovic.igor gmail.com> writes:
On Wednesday, 13 September 2017 at 19:01:52 UTC, Spacen wrote:
 Hello,

 I am trying to resurect an old project, but can't get the 
 freetype library loaded. I can't figgure out what to do it's 
 been a while. I have just built the freetype 2.6 library with 
 visual studio 2015. Any tips would be appreciated.

dub build
Performing "debug" build using dmd for x86. derelict-util 2.0.6: target for configuration "library" is up to date. derelict-ft 1.1.3: building configuration "library"... derelict-gl3 1.0.23: target for configuration "library" is up to date. derelict-sdl2 1.9.7: target for configuration "library" is up to date. gltest ~master: building configuration "application"... Linking... To force a rebuild of up-to-date targets, run again with --force. C:\>gltest.exe Exception: Failed to load symbol FT_Stream_OpenBzip2 from shared library freetype.dll
Make sure dll is also 32bit if you are building 32bit app and your Visual Studio should have dumpbin utility which you can use to make sure the required symbols are properly exported: dumpbin /EXPORTS your.dll
Sep 13 2017
parent Mike Parker <aldacron gmail.com> writes:
On Wednesday, 13 September 2017 at 20:16:23 UTC, Igor wrote:
 Make sure dll is also 32bit if you are building 32bit app and 
 your Visual Studio should have dumpbin utility which you can 
 use to make sure the required symbols are properly exported:

 dumpbin /EXPORTS your.dll
In that case, he'd have seen a SharedLibLoadException rather than a SymbolLoadException, and the error message would be something like "foo.dll is not a valid Windows DLL" or some such.
Sep 13 2017
prev sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Wednesday, 13 September 2017 at 19:01:52 UTC, Spacen wrote:
 Hello,

 I am trying to resurect an old project, but can't get the 
 freetype library loaded. I can't figgure out what to do it's 
 been a while. I have just built the freetype 2.6 library with 
 visual studio 2015. Any tips would be appreciated.

dub build
Performing "debug" build using dmd for x86. derelict-util 2.0.6: target for configuration "library" is up to date. derelict-ft 1.1.3: building configuration "library"... derelict-gl3 1.0.23: target for configuration "library" is up to date. derelict-sdl2 1.9.7: target for configuration "library" is up to date. gltest ~master: building configuration "application"... Linking... To force a rebuild of up-to-date targets, run again with --force. C:\>gltest.exe Exception: Failed to load symbol FT_Stream_OpenBzip2 from shared library
Missing symbols usually mean a version mismatch. The latest DerelictFT requires FreeType 2.6 or later. It could also mean your shared library was compiled without bzip2 support. I'm on my phone right now else I'd check it myself, but if your library os up to date you can use derelict's selective loading mechanism to ignore missing symbols you don't need. http://derelictorg.github.io/loading/failure/
Sep 13 2017
parent reply Mike Parker <aldacron gmail.com> writes:
On Wednesday, 13 September 2017 at 22:18:07 UTC, Mike Parker 
wrote:

 Missing symbols usually mean a version mismatch. The latest 
 DerelictFT requires FreeType 2.6 or later. It could also mean 
 your shared library was compiled without bzip2 support. I'm on 
 my phone right now else I'd check it myself, but if your 
 library os up to date you can use derelict's selective loading 
 mechanism to ignore missing symbols you don't need.

 http://derelictorg.github.io/loading/failure/
Digging through the FreeType changelogs, I think it likely that it's a configuration issue -- your copy of the freetype shared library was compiled without bzip2 support.
Sep 14 2017
parent reply Spacen <spacenjasst yahoo.co.uk> writes:
On Friday, 15 September 2017 at 05:16:55 UTC, Mike Parker wrote:
 On Wednesday, 13 September 2017 at 22:18:07 UTC, Mike Parker 
 wrote:

 Missing symbols usually mean a version mismatch. The latest 
 DerelictFT requires FreeType 2.6 or later. It could also mean 
 your shared library was compiled without bzip2 support. I'm on 
 my phone right now else I'd check it myself, but if your 
 library os up to date you can use derelict's selective loading 
 mechanism to ignore missing symbols you don't need.

 http://derelictorg.github.io/loading/failure/
Digging through the FreeType changelogs, I think it likely that it's a configuration issue -- your copy of the freetype shared library was compiled without bzip2 support.
Thanks for the reply that is exactly it. I downloaded several dlls from the internet, and then decided to build it myself. I see there is a bzip configuration option but I'll need to read the documentation and presumably bzip gets linked into the dll. I managed to get the application running by ignoring these missing functions: if( symbolName == "FT_Stream_OpenBzip2" || symbolName == "FT_Get_CID_Registry_Ordering_Supplement" || symbolName == "FT_Get_CID_Is_Internally_CID_Keyed" || symbolName == "FT_Get_CID_From_Glyph_Index" ) { I imagine there will be a crash if they actually get called.
Sep 15 2017
parent Mike Parker <aldacron gmail.com> writes:
On Friday, 15 September 2017 at 16:04:52 UTC, Spacen wrote:

 Thanks for the reply that is exactly it. I downloaded several 
 dlls from the internet, and then decided to build it myself. I 
 see there is a bzip configuration option but I'll need to read 
 the documentation and presumably bzip gets linked into the dll.

 I managed to get the application running by ignoring these 
 missing functions:

        if(
                 symbolName == "FT_Stream_OpenBzip2" ||
                 symbolName == 
 "FT_Get_CID_Registry_Ordering_Supplement" ||
                 symbolName == 
 "FT_Get_CID_Is_Internally_CID_Keyed" ||
                 symbolName == "FT_Get_CID_From_Glyph_Index"
             ) {

 I imagine there will be a crash if they actually get called.
If you call them, yes. Or if you link with any third-party D libraries that call them with the expectation that you've loaded them (but I don't know of any such thing).
Sep 15 2017