unity-wrapper-vorbis icon indicating copy to clipboard operation
unity-wrapper-vorbis copied to clipboard

Not working on Unity Editor with Macbook Pro M1

Open elic-sightful opened this issue 1 year ago • 11 comments

I'm trying this in a project running in Android, and it is working correctly there.

However, on my Unity Editor, I'm getting this error: DllNotFoundException: VorbisPlugin assembly:<unknown assembly> type:<unknown type> member:(null)

Tried putting in different locations, adding an assembly definition, but nothing helped.

I'm thinking it might be that the binaries are compiled for Intel processors (since the readme states it was tested on those), and that's why it's failing to load.

So to test this, I'm trying to compile from sources as well, but getting problems there as well:

ld: Undefined symbols:
  _vorbis_encode_init_vbr, referenced from:
      _write_all_pcm_data_using_on_write_callback in VorbisPluginEncoder.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/eliasc/Stuff/unity-wrapper-vorbis/projects/CMake/buildOSX/VorbisPluginBuild/Release/libVorbisPlugin.dylib normal (in target 'VorbisPlugin' from project 'VorbisPlugin')
(1 failure)

elic-sightful avatar Mar 17 '24 16:03 elic-sightful

Hi there,

I'm experiencing the same issue as described here. Have you found a solution yet? Any help or updates would be greatly appreciated!

Thanks!

zhangxiaojun92 avatar Apr 24 '24 13:04 zhangxiaojun92

I didn't find any solution, had to give up using it.

elic-sightful avatar Apr 24 '24 14:04 elic-sightful

I found solution.

  1. add target_link_libraries(VorbisPlugin ${CMAKE_CURRENT_BINARY_DIR}/vorbis_build/lib/Release/libvorbisenc.a) to projects/CMake/CMakeLists.txt
  2. cmake -S . -B ./buildOSX -G Xcode -DVORBIS_OSX=1 -DCMAKE_OSX_ARCHITECTURES=arm64
  3. cmake --build ./buildOSX --config Release

Good luck.

zhangxiaojun92 avatar Apr 25 '24 09:04 zhangxiaojun92

Hi guys! Sorry for the late reply. I am currenly busy on other projects.

I already fixed similar issue in my other plugin where the Mac arm64 was not supported. I will try to find time in the next days to apply the same fix also to this plugin.

As I remember the fix is similar to the new @zhangxiaojun92 shared. But the fix I made will include both architectures at the end: for intel and arm processors. So that it works on old and new Mac OSX systems.

gindemit avatar Apr 26 '24 17:04 gindemit