Mac M1 failed to load native library

I used the SampleNativeLibrary method on the Intel CPU, and everything was normal, but I did not work well on the m1 CPU, and it could not be loaded. Is this the problem of mono? I don’t know what I need to do to load the native library normally. (I tested the native library on. net 7 and it can be loaded normally.)
Are there any cases or prompts of successfully loading native library on m1 cpu?
Thank you in advance!
macbook pro m1
Rhino 7
-Lian

M1 is ARM so I suppose you need to recompile the library?

Rosetta works process-wide and maybe Rhino is running natively so your x86-64 library doesn’t work.

I have recompiled this library under ARM and tested it with .net 7. Everything is normal.

@dale Can you help me?

@Lian,

Have you tried building a universal binary?

https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary

– Dale

Thank you! It solved my problem perfectly.
– Lian