When trying to load Python on iOS within a framework I was getting the following error:
dyld: Symbol not found: _GENERAL_NAME_free
Referenced from: /.../data/Containers/Bundle/Application/D4..9D/demo.app/Frameworks/Python.framework/Libraries/libpython2.7.dylib
Expected in: flat namespace
Expected in flat namespace? What?
What's also interesting is that it would load fine if all the libraries were linked directly to the executable. Well turns out it was giving the error when just liking to the Python.framework because that was only linking Python, not all the dependencies python has (libffi and openssl).
I had the correct CFLAGS and LDFLAGS for including a dependency and headers so it compiled fine. But when it went to load, iOS didn't know where to find the dependent libraries! Added in the missing " -l<lib>" flags, recompiled, verified with "otool -L" and all is good to go!
Happy coding!
Comments
Post a Comment