I was trying to figure out what the heck was happening with a couple dylibs I'd been using that are not wrapped into plugins
Sometimes the wrong function seemed to get called.

Here's the simplified set up

I have a very simple dylib that has the compiled result of

        long testFunction(long value)
                return value + 500 ;
Call this libraryA

And in another I have

        long testFunction(long value)
                return value ;

Call this libraryB

Then in REALbasic I have a single method that has a deliberate use of the Alias to enable access to the two libraries in one method as follows

soft declare function testFunction lib "libraryA.dylib" (v as integer) as integer soft declare function testFunction2 lib "libraryB.dylib" alias "testFunction" (v as integer) as integer

  dim i as integer
  dim j as integer
  dim k as integer

  i = 123

  j = testFunction(i)
  k = testFunction2(i)

to my surprise despite trying to call different functions in two different libraries both j and k get the same result from calling the same function.

OK ... so I put calls to each function in their own method (still in the same class) and see if that helps
Nope.

OK ... so take the two calls and put them in separate modules.
No luck.

After reading how dlopen and such work is this even possible using those functions ? And, since plugins contain dylibs how is this avoided if two plugins have the same signature for a function ?


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to