We’re trying to get a big golang project accessible in Unity on OS X. golang offers a C exporter that outputs a header .a library (buildmode=c-shared or c-archive).
The plan was to make a bundle that includes that library while doing necessary. When Unity tries to load our bundle, there’s runtime error that the .a library in the bundle can’t be found (see below). This will be an exciting project to share more about if we can get this step going.
I already tried putting a copy of the .a in the obvious places (alongside the .bundle the Plugins dir and alongside the bundle’s binary).
Runtime error: (buildmode=c-shared)
Couldn’t open /…/PDI.bundle/Contents/MacOS/PDI, error: dlopen(/…/PDI.bundle/Contents/MacOS/PDI, 2): Library not loaded: libloplex.a
Using golang’s export buildmode=c-archive mode addresses the library not found issue, buuut it consistently crashes Unity when it goes to load/link our bundle. Unity’s trap mechanism doesn’t even get invoked – it’s a force quit. I’ve looked at about 10-15 of them now and they do change here and there, but they hover around this area: