http://forum.lazarus-ide.org/index.php?topic=21972.0
Important notice:
After compilation of executable file you need to run following command in Terminal:
./install_wsq_library.sh

Or you can do that manually according to instructions which are based on information in page:
https://wiki.lazarus.freepascal.org/macOS_Dynamic_Libraries
//
After creating an application bundle you need to:
//
1. Delete the wsq_demo.app/Contents/MacOS/wsq_demo symbolic link to the wsq_demo executable file
2. Copy the wsq_demo executable file into the wsq_demo.app/Contents/MacOS directory
3. Copy libWSQ_library64.so file into the wsq_demo.app/Contents/MacOS directory
4. Open a Terminal (Applications > Utilities > Terminal)
5. Change into the wsq_demo.app/Contents/MacOS directory:
cd wsq_demo.app/Contents/MacOS
//
6. In Terminal enter command:
install_name_tool -change libWSQ_library64.so "@executable_path/./libWSQ_library64.so" wsq_demo
//
This ensures that the wsq_demo executable in your application bundle will look in correct directory to find your dynamic library.
                                                                                                                                      


