# Csound can’t find/load custom plugin on Mac M1 Laptop

**URL:** <https://forum.csound.com/t/csound-can-t-find-load-custom-plugin-on-mac-m1-laptop/838>\
**Category:** Developers\
**Created:** [September 14, 2022, 7:32am UTC](https://forum.csound.com/t/csound-can-t-find-load-custom-plugin-on-mac-m1-laptop/838 "2022-09-14T07:32:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lovre](https://forum.csound.com/letter_avatar_proxy/v4/letter/l/bbce88/32.png) [@Lovre](https://forum.csound.com/u/Lovre)\
**Post date:** [September 14, 2022, 7:32am UTC](https://forum.csound.com/t/csound-can-t-find-load-custom-plugin-on-mac-m1-laptop/838/1 "2022-09-14T07:32:33Z")

</div>

Dear Csounders!

I have some strange problem that Csound can’t find or load a plugin using option flag _–opcode-lib_.

Strange thing is that this problem only appears on M1 laptop. On my older Mac (not M1) and Windows laptop I don’t have this issue.

On both Macs I am compiling like this:  
`gcc -std=c++11 -O2 -dynamiclib -o myopcode.dylib myopcodesrc.cpp -DUSE_DOUBLE -I/Library/Frameworks/CsoundLib64.framework/Headers -lstdc++`

I’ve also tested plugins written in C but problem is the same. In this case I’m compiling like this:  
`gcc -O2 -dynamiclib -o myopc.dylib opsrc.c -DUSE_DOUBLE -I/Library/Frameworks/CsoundLib64.framework/Headers`

Error that I get is:  
`error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or ',' or '=' (token "myopcode")`

I’ve reinstalled the Csound but it didn’t help.

OS: macOS 11.6.8 (Big Sur)  
Csound: Csound version 6.17 (double samples) Feb 2 2022 [commit: deff4f9aaeaf44f7db445c215f004bca8d50901f]

Any ideas what could be wrong?

---

<div class="post-metadata">

**Author:** ![rory](https://forum.csound.com/user_avatar/forum.csound.com/rory/32/7_2.png) [@rory](https://forum.csound.com/u/rory)\
**Post date:** [September 14, 2022, 8:01am UTC](https://forum.csound.com/t/csound-can-t-find-load-custom-plugin-on-mac-m1-laptop/838/2 "2022-09-14T08:01:42Z")

</div>

It’s probably building arm64 binaries. For now Csound is x86\_64. I usually use CMake to set arch types, but I@m sure you can do this from the command line too. You need to set it to universal, or x86\_64.

---

<div class="post-metadata">

**Author:** ![Lovre](https://forum.csound.com/letter_avatar_proxy/v4/letter/l/bbce88/32.png) [@Lovre](https://forum.csound.com/u/Lovre)\
**Post date:** [September 14, 2022, 1:16pm UTC](https://forum.csound.com/t/csound-can-t-find-load-custom-plugin-on-mac-m1-laptop/838/3 "2022-09-14T13:16:34Z")

</div>

Thanks @rory! That was the problem.

I’m not expert in this stuff so I just experimented a bit with --target and -arch compile flags but without success.

In the end I made Xcode project 😵 and made a dynamic library for x86\_64 architecture like that.
