gtk arch issues
Johnson Jones via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Aug 1 13:16:29 PDT 2017
nvm, the file exists. Why it is not being found is unknown.
I did some stuff and it says it is not a valid win32, this is
using that gtk3 runtime I linked to... says it's x64 version but
probably x86.
Would be nice if the error message printed the full path of what
was being loaded so it's quicker to diagnose.
Seems there is a
public static void loadLibrary(string library)
{
void* handle = pLoadLibrary(library);
//TODO: A more general way to try more than one version.
if ( handle is null && library == importLibs[LIBRARY.GSV] )
handle = pLoadLibrary(importLibs[LIBRARY.GSV1]);
if ( handle is null )
throw new Exception("Library load failed ("~ library ~"): "~
getErrorMessage());
loadedLibraries[library] = handle;
}
private void* pLoadLibrary(string libraryName, int flag =
RTLD_NOW)
{
void* handle =
dlopen(cast(char*)toStringz(basePath.buildPath(libraryName)),
flag | RTLD_GLOBAL);
if(!handle){
lastError = dlerror().fromStringz.idup;
}
// clear the error buffer
dlerror();
return handle;
}
private void setDllPath()
{
static bool isSet;
if ( isSet )
return;
string gtkPath = getGtkPath();
if ( gtkPath.length > 0 )
SetDllDirectoryA((gtkPath~'\0').ptr);
isSet = true;
}
which is used, could I just hijack this to set the correct path
based on what version it is compiled under? Would be the easiest
thing, at least as a temporary workaround.
More information about the Digitalmars-d-learn
mailing list