I was able to get rid of the GSM loading error thanks to your reply. It turns out that I was missing the -install_name, -compatibility_version and -current_version flags when creating the dynamic library. Unfortunately, now the program is simply exiting without any errors.