4 Replies
      Latest reply on Mar 8, 2016 8:26 PM by jbaraga
      jbaraga Level 1 Level 1 (0 points)

        I am having difficulty adding openssl to an iOS project for receipt validation. XCode 7.2.1, Swift.


        For convenience, I am using the latest build of openssl posted on the Receigen site, openssl-1.0.2f-iOS.  I have set the user search paths to the include folder pathway, and have added the libcrypto.a library to "Linked Frameworks and Libraries" in the project settings.  When I do this, I get the following error during build:


        ld: library not found for -lcrypto
        clang: error: linker command failed with exit code 1 (use -v to see invocation)


        I have followed the exact same procedure for adding openssl to OSX projects without encountering this error.


        I have spent a few hours searching the web for a solution.  I have tried several without success, including:

        1. Disabling bitcode.
        2. Altering the "Build Active Architecture Only" setting.
        3. Deleting the files in the DerivedData folder.
        4. Cleaning the project.
        5. Rebooting.


        What am I overlooking?  Any help would be most appreciated.

        • Re: Problem adding openssl to iOS project
          PBK Level 7 Level 7 (3,435 points)

          Here are two comments for your consideration.  There is a setting called 'always search users search paths' that is a few lines above where you set users search path and it must be 'yes'.  Also it is unusual that the error refers to 'lcrypto' not 'libcrypto'' - perhaps your OpenSSL was compiled against a different library and you need to obtain that library or rename yours.  There is also a second library you need to link.