www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Anybody use Derelict FreeType recently (successfully)

reply WhatMeWorry <kheaser gmail.com> writes:
Compiling and linking was error free, but when I hit

DerelictFT.load();

my program aborts with the following run time message:

derelict.util.exception.SymbolLoadException source\derelict\u
il\exception.d(35): Failed to load symbol FT_Reference_Face from shared library
freetype.dll

First of all, I'm not sure if I have a valid freetype.dll file. 
How does one tell?  I downloaded freetype-2.6 but couldn't find 
anything there.  I downloaded freetype-2.3.5 and found a 
freetype6.dll which I renamed to freetype.dll because that was 
want an online discussion said.

This then caused a new error where it said that zlib1.dll could 
not be found so I downloaded that.  Ran it again and now I am 
stuck with the exception above.

Can anybody help a fellow traveler?  Thanks.
Sep 16 2015
parent reply Mike Parker <aldacron gmail.com> writes:
On Thursday, 17 September 2015 at 04:58:05 UTC, WhatMeWorry wrote:
 Compiling and linking was error free, but when I hit

 DerelictFT.load();

 my program aborts with the following run time message:

 derelict.util.exception.SymbolLoadException source\derelict\u
il\exception.d(35): Failed to load symbol FT_Reference_Face from shared library
freetype.dll
This function was added to FreeType in version 2.4.2, so you will see this error when trying to load an older version.
 First of all, I'm not sure if I have a valid freetype.dll file. 
 How does one tell?  I downloaded freetype-2.6 but couldn't find 
 anything there.  I downloaded freetype-2.3.5 and found a 
 freetype6.dll which I renamed to freetype.dll because that was 
 want an online discussion said.
DerelictFT currently requires FreeType 2.5 or later (though I've not yet looked into updating to the 2.6 API). What problem did you have with the 2.6 binary you downloaded? Using the 2.3.5 and 2.4.2 binaries is bound to result in SymbolLoadExceptions, as any functions added in 2.5 will not be present in those binaries. You can work around this by building your own if you can't find anything precompiled online, but if you aren't using any 2.5 features, I would suggest you look into using DerelictUtil's selective symbol loading mechanism[1]. You'll need to decide a minimum version of FreeType to support, then diff the headers from that version with later releases to see which functions were added in later versions. Check for those functions in a MissingSymbolCallback and you can load without any SymbolLoadExceptions. Also, an alternative to renaming the DLL is to pass the name directly to the loader: Version(Windows) DerelictFT.load("freetype6.dll"); else DerelictFT.load(); [1] http://derelictorg.github.io/using/fail.html
Sep 16 2015
parent reply WhatMeWorry <kheaser gmail.com> writes:
On Thursday, 17 September 2015 at 05:27:08 UTC, Mike Parker wrote:
 On Thursday, 17 September 2015 at 04:58:05 UTC, WhatMeWorry 
 wrote:
 Compiling and linking was error free, but when I hit

 DerelictFT.load();

 my program aborts with the following run time message:

 derelict.util.exception.SymbolLoadException source\derelict\u
il\exception.d(35): Failed to load symbol FT_Reference_Face from shared library
freetype.dll
This function was added to FreeType in version 2.4.2, so you will see this error when trying to load an older version.
 First of all, I'm not sure if I have a valid freetype.dll 
 file. How does one tell?  I downloaded freetype-2.6 but 
 couldn't find anything there.  I downloaded freetype-2.3.5 and 
 found a freetype6.dll which I renamed to freetype.dll because 
 that was want an online discussion said.
DerelictFT currently requires FreeType 2.5 or later (though I've not yet looked into updating to the 2.6 API). What problem did you have with the 2.6 binary you downloaded? Using the 2.3.5 and 2.4.2 binaries is bound to result in SymbolLoadExceptions, as any functions added in 2.5 will not be present in those binaries. You can work around this by building your own if you can't find anything precompiled online, but if you aren't using any 2.5 features, I would suggest you look into using DerelictUtil's selective symbol loading mechanism[1]. You'll need to decide a minimum version of FreeType to support, then diff the headers from that version with later releases to see which functions were added in later versions. Check for those functions in a MissingSymbolCallback and you can load without any SymbolLoadExceptions. Also, an alternative to renaming the DLL is to pass the name directly to the loader: Version(Windows) DerelictFT.load("freetype6.dll"); else DerelictFT.load(); [1] http://derelictorg.github.io/using/fail.html
Ok. I could not find a pre-compiled freetype.dll so I downloaded Freetype 2.5.5 and built it anew with a new install of Visual Studio 2015. But now I'm getting a run time error saying: derelict.util.exception.SymbolLoadException source\derelict\util\exception.d(35): Failed to load symbol FT_Init_FreeType from shared library freetype.dll After hours of reading existing freetype/derelict documents, I'm stuck again. Any suggestions. Thanks.
Sep 17 2015
parent reply BBasile <bb.temp gmx.com> writes:
On Thursday, 17 September 2015 at 22:22:22 UTC, WhatMeWorry wrote:
 [...]
 After hours of reading existing freetype/derelict documents, 
 I'm stuck again.
 Any suggestions. Thanks.
Hello, this[1] compiled dll one works fine here on windows: - inside this folder: https://github.com/buggins/dlangui/tree/master/libs/windows/x86 - with DerelictFT head 66dd3dd516c4431b627e299c8b4b5074d6096b51 eg: --- static this() { DerelictFT.load(); } void main(string[] args) { FT_Library handle; int v0,v1,v2; FT_Init_FreeType(&handle); FT_Library_Version(handle, &v0, &v1, &v2); writeln(v0," ",v1," ",v2); } --- outputs: 2 5 5 so just clone or download the tarball to get the right dll :)
Sep 17 2015
parent reply BBasile <bb.temp gmx.com> writes:
On Friday, 18 September 2015 at 00:13:41 UTC, BBasile wrote:
 On Thursday, 17 September 2015 at 22:22:22 UTC, WhatMeWorry 
 wrote:
 [...]
 After hours of reading existing freetype/derelict documents, 
 I'm stuck again.
 Any suggestions. Thanks.
Hello, this[1] compiled dll one works fine here on windows: - inside this folder: https://github.com/buggins/dlangui/tree/master/libs/windows/x86 - with DerelictFT head 66dd3dd516c4431b627e299c8b4b5074d6096b51 eg: --- static this() { DerelictFT.load(); } void main(string[] args) { FT_Library handle; int v0,v1,v2; FT_Init_FreeType(&handle); FT_Library_Version(handle, &v0, &v1, &v2); writeln(v0," ",v1," ",v2); } --- outputs: 2 5 5 so just clone or download the tarball to get the right dll :)
Is it OK now ? https://www.youtube.com/watch?v=vDgo2xUk9h8
Sep 18 2015
parent reply WhatMeWorry <kheaser gmail.com> writes:
On Friday, 18 September 2015 at 16:34:16 UTC, BBasile wrote:
 On Friday, 18 September 2015 at 00:13:41 UTC, BBasile wrote:
 On Thursday, 17 September 2015 at 22:22:22 UTC, WhatMeWorry 
 wrote:
 [...]
 After hours of reading existing freetype/derelict documents, 
 I'm stuck again.
 Any suggestions. Thanks.
Hello, this[1] compiled dll one works fine here on windows: - inside this folder: https://github.com/buggins/dlangui/tree/master/libs/windows/x86 - with DerelictFT head 66dd3dd516c4431b627e299c8b4b5074d6096b51 eg: --- static this() { DerelictFT.load(); } void main(string[] args) { FT_Library handle; int v0,v1,v2; FT_Init_FreeType(&handle); FT_Library_Version(handle, &v0, &v1, &v2); writeln(v0," ",v1," ",v2); } --- outputs: 2 5 5 so just clone or download the tarball to get the right dll :)
Is it OK now ? https://www.youtube.com/watch?v=vDgo2xUk9h8
Sorry, meant to get back but got busy. Yes, works great! Thanks! Not sure why I had so much trouble finding a freetype.dll library. Had no problems with OpenAL and FreeImage.
Sep 19 2015
parent reply Mike Parker <aldacron gmail.com> writes:
On Saturday, 19 September 2015 at 15:01:06 UTC, WhatMeWorry wrote:
 Sorry, meant to get back but got busy.  Yes, works great!  
 Thanks!

 Not sure why I had so much trouble finding a freetype.dll 
 library. Had no problems with OpenAL and FreeImage.
I'm curious how you compiled the DLL that failed to load. Did you use one of the Visual Studio project files that ship with the FreeType source? Or the Makefile?
Sep 19 2015
parent reply WhatMeWorry <kheaser gmail.com> writes:
On Sunday, 20 September 2015 at 01:59:19 UTC, Mike Parker wrote:
 On Saturday, 19 September 2015 at 15:01:06 UTC, WhatMeWorry 
 wrote:
 Sorry, meant to get back but got busy.  Yes, works great!  
 Thanks!

 Not sure why I had so much trouble finding a freetype.dll 
 library. Had no problems with OpenAL and FreeImage.
I'm curious how you compiled the DLL that failed to load. Did you use one of the Visual Studio project files that ship with the FreeType source? Or the Makefile?
For my D programming I use the Visual D Studio package (plug-in?) with the "free Visual Studio Shell (2013). I download Visual Studio Express 2015 and used the FreeType 2.6 solution file. (So no makefile). I tried making both a 32 and 64 bit freetype.dll I've got a 64 bit Windows 8.1 machine, but I tried to leave no stone untouched. I'm kinda self taught, so I might have made an error somewhere. Or Could Visual Studio Express 2015 be too new? PS. Derelict is great. I'm using FreeImage and OpenAL as well. .
Sep 19 2015
parent Mike Parker <aldacron gmail.com> writes:
On Sunday, 20 September 2015 at 02:58:21 UTC, WhatMeWorry wrote:

 For my D programming I use the Visual D Studio package 
 (plug-in?) with the "free Visual Studio Shell (2013).

 I download Visual Studio Express 2015 and used the FreeType 2.6 
 solution file. (So no makefile).

 I tried making both a 32 and 64 bit freetype.dll  I've got a 64 
 bit Windows 8.1 machine, but I tried to leave no stone 
 untouched.

 I'm kinda self taught, so I might have made an error somewhere.
  Or Could Visual Studio Express 2015 be too new?
The new unified C runtime that MS uses with VS 2015 could potentially be an issue, but you would have seen a SharedLibLoadException if that were a problem in this case. I'll play around with it when I have time. I want to try to reproduce it if possible so that if it turns out to be an issue others are likely to face, I can add a warning to the future documentation about how *not* to build FreeType on Windows. I've had problems with Visual Studio builds of open source libraries in the past. The project solutions that they ship are often outdated, missing certain files or options. Visual Studio support tends to, understandably, lag behind in projects that are primarily maintained by Linux or Mac users, so it's often up to community members to keep it updated. For that reason, I prefer to build Windows DLLs with MinGW + MSYS2. I rarely have any issues taking that approach.
 PS.  Derelict is great.  I'm using FreeImage and OpenAL as well.
Thanks!
Sep 20 2015