www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Stupid User error with DUB/Derelict runtime issue?

reply WhatMeWorry <kheaser gmail.com> writes:
Dub/Derelict is returning the following error at the D line:


     DerelictFT.load();	// Load the FreeType library


derelict.util.exception.SharedLibLoadException C:\Users\kheaser\AppData\Roaming\dub\packages\derelict-util-2.0.6\source\derelict\u
il\exception.d(35): Failed to
  load one or more shared libraries:
         freetype.dll - The specified module could not be found.
         libfreetype.dll - The specified module could not be found.
         libfreetype-6.dll - %1 is not a valid Win32 application.

What's up with the three DLLs?  Shouldn't just one suffice?  And 
what's up with %1 ?


Strangely enough, I've got a working Visual Studio project with 
the same FreeType load command that works fine?  It uses

09/17/2015  08:28 PM           593,920 libfreetype-6.dll


I tried just copying and pasting this .dll into the same folder 
as the failing .exe
but it still returns the above error.

Thanks.
Oct 05 2016
parent Mike Parker <aldacron gmail.com> writes:
On Thursday, 6 October 2016 at 00:13:20 UTC, WhatMeWorry wrote:
 Dub/Derelict is returning the following error at the D line:


     DerelictFT.load();	// Load the FreeType library


 derelict.util.exception.SharedLibLoadException C:\Users\kheaser\AppData\Roaming\dub\packages\derelict-util-2.0.6\source\derelict\u
il\exception.d(35): Failed to
  load one or more shared libraries:
         freetype.dll - The specified module could not be found.
         libfreetype.dll - The specified module could not be 
 found.
         libfreetype-6.dll - %1 is not a valid Win32 application.

 What's up with the three DLLs?  Shouldn't just one suffice?
Some shared libraries can be found in the wild using different formats for the file names. In the cases where I'm aware of it, as in this one, I've implemented the loaders to attempt to load them all. If any one of them is present, the load will be successful. If not, they are all listed in the exception message.
 And what's up with %1 ?
This is an error message from the operating system. The 'not a valid Win32 application' message usually arises when you try when you have an architecture mismatch between the shared library you are trying to load and your application. That is, one of them is 32-bit and the other 64-bit. My guess is you are compiling using the default DMD toolchain, which is 32-bit, but your FreeType DLL is 64-bit. Could that be your problem?
Oct 05 2016