Creating a .dylib file

Hi. I want to create a .dylib file for my project. So I downloaded the example of creating a class from this link and ran the .sh file. The .o and .so files were created and then I got the following error. however, the load_d.edp runs without any errors. I will be grateful for any help.

➜  class git:(master) ✗ source
g++ -c -fPIC '-I/usr/local/lib/ff++/4.10/include' -g -O2 -DNDEBUG -O3 -mtune=generic -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -I/usr/local/ff-petsc/r/include -I/usr/include/hdf5/serial -I/usr/include 'class_d.cpp'

g++ -shared -fPIC -g -O2 -DNDEBUG -O3 -mtune=generic -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -I/usr/local/ff-petsc/r/include -I/usr/include/hdf5/serial -I/usr/include 'class_d.o' -o

g++: error: dynamic_lookup: No such file or directory
g++: error: unrecognized command line option ‘-bundle’