0 Replies Latest reply on Jun 6, 2012 10:40 AM by shoggoth000

    ANE with 3rd party libraries

    shoggoth000 Level 1

      Short Version:  How does one package 3rd party dylib dependencies with an ANE on MacOS?

       

      Extended Version:

       

      I have an ANE that dynamically links with 3rd party libraries.  I am working on MacOS.

       

      My ANE framework dylib file links with the 3rd party library dylib.  However, when I package a bundle application with the ANE, the ANE fails to initialize, throwing an Error: "ArgumentError: Error #3500".  I have inferred that the issue is failure to find and link my 3rd party library dylib.

       

      If I run my AIR app from a Working Directory that contains the 3rd party library, everything works.  This implies that the linker is only looking in the Current Working Directory and not the locations of the 3rd party dylibs.

       

      I have included my 3rd party dylibs with my ANE framework, for instance:

       

      MyANE.framework/MyANE

      MyANE.framework/Resources/3rdparty.dylib

       

      I have used otool to inspect the linkage for MyANE.framework/MyANE:

       

      MyANE:

                libMyANE.dylib (compatibility version 0.0.0, current version 0.0.0)

                @rpath/Adobe AIR.framework/Versions/1.0/Adobe AIR (compatibility version 1.0.0, current version 1.0.0)

                ./3rdparty.dylib (compatibility version 1.0.0, current version 1.0.0)

            /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)

                /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

       

      Ok, you see that it wants to load from CWD.  I tried changing the 3rdparty.dylib linkage, as so:

       

      install_name_tool -change ./3rdparty.dylib @loader_path/Resources/3rdparty.dylib MyANE

       

      but the application displays exactly the same behavior:  It only works if I run from the folder containing 3rdparty.lib.

       

      Are there some kind of additional platform options I have to set while packaging the ANE?

       

      Thanks!

      JW