Skip to main content
megamau
Inspiring
September 5, 2016
Answered

Calling ExternalObject in OSX gives me IOError: I/O Error.

  • September 5, 2016
  • 2 replies
  • 755 views

Hello,

I have a script as a complement of a plugin, and I use the ExternalObject class in javascript to call an internal function in my plugin.

Everything works as expected in windows, but I'm getting an IOError in OSX. I know the path for the lib is correct, if it wasn't, the error would be different.

I think it has nothing to do with the actual exported function either, as the script never gets to the point of calling it. Either way, I checked the library exports, and my function is "visible" from the outside.

this is what I have:

try
{
var myLib = new ExternalObject("lib:" + pluginPath + libFilename);
myLib.execute("requeststatus");
myLib.unload();
}
catch(e)
{
alert(e);
}

The script halts when the first line is executed, It never reaches the second line with the actual execute. I also copied the library to another path to avoid problems with permissions, but no change in the result.

Any help would be appreciated.

This topic has been closed for replies.
Correct answer megamau

Just solved my own problem.

It turns out I had to specify the bundle name of the library, not the library itself.

Eg:

wrong: MyLib.bundle/Contents/MacOS/MyLib

right: MyLib.bundle

I was not expecting this, as I implemented some other dynamically loaded libs in C++ and I always used the full path, not the just bundle name. What's important thought is that it's working now.

2 replies

cqt18342843
Participating Frequently
April 18, 2019

Please teach me     how to write   my own simple DLL function.

megamau
megamauAuthorCorrect answer
Inspiring
September 6, 2016

Just solved my own problem.

It turns out I had to specify the bundle name of the library, not the library itself.

Eg:

wrong: MyLib.bundle/Contents/MacOS/MyLib

right: MyLib.bundle

I was not expecting this, as I implemented some other dynamically loaded libs in C++ and I always used the full path, not the just bundle name. What's important thought is that it's working now.