How are csound opcodes compiled from c++ code into a csound opcode
How to compile c++ into csound opcode
Check out these examples. If you clone the repo you should be able to add your own code and use the existing cmake build system to compile them into opcodes. The build scripts here, buildWin64.ps1, buildLinux.sh and buildOSX.sh all show how to build the opcodes once you have cloned the repo. Good luck.