For instance, when you develop in Edit mode, the loading path will be
./Assets/Plugins/osxplugin.bundle/Contents/Resources/thirdparty.dylib
But when you build a release version, the loading path will be
./Contents/Plugins/osxplugin.bundle/Contents/Resources/thirdparty.dylib
Mac OSX provide a command line tool to modify that.
$ install_name_tool -id @loader_path/thirdparty.dylib thirdparty.dylib
You could use otool to check dylib status.
eg.
$ otool -L libcurl.dylib libcurl.dylib: @loader_path/libcurl.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
Now, you can develop and build a unity app without dylib loading issue.
沒有留言:
張貼留言