uppressed: java.lang.UnsatisfiedLinkError: dlopen(xxx/xxx.dylib, 0x0009): tried: 'xxx/xxx.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
出现这个问题,去重新编译一下动态链接库就好了
在CMakeList.txt 中加入 set(CMAKE_OSX_ARCHITECTURES "x86_64")
,重新编译出来,放到正确的位置应该就可以正常使用。
另外可以输入命令 lipo -info xxx.dylib
查看当前动态库支持的架构