GameAnalytics / GA-SDK-GODOT

Official GameAnalytics Godot SDK repository
MIT License
42 stars 8 forks source link

Version mismatch on libGameAnalytics.dylib when building for OSX #6

Closed superoven closed 3 years ago

superoven commented 3 years ago

When following the docs to build Godot with the gameanalytics library module, I get this error when compiling for Mac OSX (10.15.4):

scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)

ld: warning: dylib (modules/gameanalytics/cpp/lib/osx/libGameAnalytics.dylib) was built for newer macOS version (10.15) than being linked (10.9)
[Initial build] scons: done building targets.

It fails here and does not make the Godot binary. From the best of my understanding, this means that the library file wasn't built with the latest version of OSX (10.15), it was built with 10.9, and therefore can't be linked? Should one need to rebuild this for the system that they intend to use it with or am I misunderstanding something?

the1schwartz commented 3 years ago

I get that warning as well when building but it shouldn't fail from building the binary because of that warning I think. Do you get any other errors?

superoven commented 3 years ago

It appears that I was misunderstanding the errors. I thought it wasn't creating the binary. I'm still having issues when actually using the dylib file however. The documentation claims:

Which I understand means that I should be taking the file GA-SDK-GODOT/gameanalytics/cpp/lib/osx/libGameAnalytics.dylib and copying it to the /bin directory of my godot source. I have a resulting bin directory of simply

$ ls bin
godot.osx.tools.x86_64 libGameAnalytics.dylib

When I naively attempt to run this file:

$ bin/godot.osx.tools.x86_64 
dyld: Library not loaded: @rpath/libGameAnalytics.dylib
  Referenced from: ~/godot/bin/godot.osx.tools.x86_64
  Reason: image not found
[1]    8672 abort      bin/godot.osx.tools.x86_64

It appears to not know how to find the file, perhaps it isn't set to check its own directory for the library. What I'm wondering is am I misunderstanding the documentation or is there somewhere else that the library file must be located?

the1schwartz commented 3 years ago

I think it is mentioned in the documentation about this error how to fix it: https://gameanalytics.com/docs/item/godot-sdk#mac