Search code examples
xcodecmakefann

FANN Xcode code sign issue


My development environment is:

OSX Mavericks, Xcode 5 Cocoa mac application

I have been using FANN to train and run a ANN. It has worked so far and I have been able to train and run an ANN. I have even made a simple command line application to train ANNs using FANN. However I have run into a problem that may have to do with the way FANN is distributed. I wanted to export and share the application I had made, so I archived the Xcode project. When I did this I made sure to copy libfann.2.2.0.dylib under Build phases, so the end user would have the library which is needed to use the FANN code in my app. However when I tried to save a developer ID sign application using Xcode it failed to code sign it. I can still save it without code signing it. The interesting thing is that if I remove libfann.2.2.0.dylib from the copying phase under Build phases, Xcode can successfully code sign the application and save it. However if I do this the resulting application is corrupt because it cannot find the FANN library. I made libfann.2.2.0.dylib according to the instructions on http://leenissen.dk/fann/wp/help/installing-fann/. I understand that this may not be a problem with FANN, but with Xcode. However I have other static libraries in the same project and FANN is the only one that is creating these issues, so I believe there is a high chance it has something to do with the FANN library. I am not an expert in code signing, but my guess is that there is a conflict between the way the FANN library is made using Cmake and code signing. Thanks in advance.


Solution

  • I was able to find a solution after playing around with code signing. I decided to try manually code signing my app with instructions from http://www.digicert.com/code-signing/mac-os-codesign-tool.htm. This did not work. However the code signing tool pointed me to a problem with libfann.2.2.0.dylib. So I checked if libfann.2.2.0.dylib was code signed and it was not. When I saw this I thought I would try code signing libfann.2.2.0.dylib with my developer ID and re-importing it into my project. This strategy worked and I was able to export a developer ID signed version of my application.