Compiling a static library for iOS using OpenMP

I am writing a simple cross-platform library that uses OpenMP, but I cannot figure out how to test it in an application for the iPhone.
I am running OS X , with GCC 4.7 , I compiled it as a static library, I also managed to link it with libgomp.a and add it to my test application in Xcode. The application is created without any errors or warnings, but when I run it in the iPhone simulator, all I get is an error message:

 dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address Referenced from: /opt/local/lib/gcc47/i386/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: ___emutls_get_address Referenced from: /opt/local/lib/gcc47/i386/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib 

I read that in previous versions of GCC there was a bug in ___emutls_get_address , but now it needs to be fixed. Do you have any ideas what might be wrong?

+6
source share
1 answer

He is looking for a dynamic library that does not exist. Since you cannot use dynamic libraries on the device itself, it does not work on the device, but not during assembly. You should try to rebuild the library as .a files manually and make sure that you use any -l arguments. This is the best I have for you. Assuming this is not a jailbroken (maybe true), you just need to bundle it manually. You can always simply add library code files to your project.

Hope this helps.

+2
source

Source: https://habr.com/ru/post/924295/


All Articles