"unable to load foreign library"

Monte Goulding monte at appisle.net
Fri Apr 15 01:30:04 CEST 2016

Hi Dar!

The dylib should be found if it is in resources/code/mac/

// This is the callback given to libscript so that it can resolve the absolute
// path of native code libraries used by foreign handlers in the module. At
// the moment we use the resources path of the module, however it will need to be
// changed to a separate location at some point with explicit declaration so that
// iOS linkage and Android placement issues can be resolved.
// Currently it expects:
//   <resources>
//     code/
//       mac/<name>.dylib
//       linux-x86/<name>.so
//       linux-x86_64/<name>.so
//       win-x86/<name>.dll
static bool MCEngineResolveSharedLibrary(MCScriptModuleRef p_module, MCStringRef p_name, MCStringRef& r_path)
    // If the module has no resource path, then it has no code.
    MCAutoStringRef t_resource_path;
    if (!MCEngineLookupResourcePathForModule(p_module, Out(t_resource_path)))
        return false;
    if (MCStringIsEmpty(*t_resource_path))
        return false;
#if defined(_MACOSX)
    return MCStringFormat(r_path, "%@/code/mac/%@.dylib", *t_resource_path, p_name);
#elif defined(_LINUX) && defined(__32_BIT__)
    return MCStringFormat(r_path, "%@/code/linux-x86/%@.so", *t_resource_path, p_name);
#elif defined(_LINUX) && defined(__64_BIT__)
    return MCStringFormat(r_path, "%@/code/linux-x86_64/%@.so", *t_resource_path, p_name);
#elif defined(_WINDOWS)
    return MCStringFormat(r_path, "%@/code/win-x86/%@.dll", *t_resource_path, p_name);
    return false;



> On 15 Apr 2016, at 9:10 AM, Dar Scott <dsc at swcp.com> wrote:
> I want to see the "Widgets by Dar" collection, too!  I'm not sure if I want the snap-together widgets or the "who needs LabView when you have LiveCode" widgets first.  I might start with some libraries.  
> And I still haven't solved the issue with this error message.  I've tried putting my dynamic library everywhere and even popped it out of its own folder.  

More information about the use-livecode mailing list