Linking armadillo with Xcode

后端 未结 2 1759
故里飘歌
故里飘歌 2021-01-06 14:30

I have a large existing Xcode project and now I want to add the armadillo library to it .

http://arma.sourceforge.net/

I have downloaded it (with macports)

相关标签:
2条回答
  • 2021-01-06 14:42

    I recently had a similar problem – Linking armadillo with Xcode.

    I'll tell you how I fixed it. Two steps were necessary:

    1) the xcode needs to "see" the file libarmadillo.dylib (mine, located at /usr/lib/) – it is Not the same as using libarmadillo.3.81.1.dylib directly.

    In order to do that, create a link to the file on xcode libraries (mine, located at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/).

    In summary: $ sudo ln -s /usr/lib/libarmadillo.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libarmadillo.dylib

    2) now I needed to "tell" the xcode to include this library on compile command.

    For that:

    1. open your project (make sure you do that after create the link mentioned above)
    2. go to the TARGETS (I have only one so...)
    3. click on Build Phases tab
    4. find 'Link Binary With Libraries' and click on + (Add items)
    5. on the new opened window type armadillo and by now you should be seeing the library libarmadillo.dylib in front of you, just add it!

    P.S. Within the header files whose armadillo was used, I included it using the full path (in my case, #include "/usr/include/armadillo")

    That is it, I wish I could have helped you out.

    0 讨论(0)
  • 2021-01-06 14:58

    Try to add libz.lib to your build target:

    Add libz to your Link Binary With Libraries Build Phase

    1. Select your Project in the Project Navigator
    2. Select the target you want to enable the SDK for
    3. Select the Build Phases tab
    4. Open the Link Binary With Libraries Phase
    5. Click the + to add a new library
    6. Find libz.dylib in the list and add it
    7. Repeat Steps 2 - 6 until all targets you want to use the SDK with have libz.dylib

    Source: https://testflightapp.com/sdk/doc/1.1/

    0 讨论(0)
提交回复
热议问题