I'm using ObjC to build my app's ui, and my app depends on an ansi c library, I have the ansi c library's source code. How can I use Xcode to compile this app (For development, I can install the library into my Mac). But I want to ship my app to users without any external dependency, just like any other apps, user don't need to install the dependencies, so how can I accomplish this?
Asked
Active
Viewed 210 times
2
-
1Can't you just compile the sources of the library along with the files of your project? – Nov 18 '12 at 13:37
-
@H2CO3 The source uses autoconf to build. I don't know how to compile with it in Xcode. And I don't find any articles about it on the internet. Can you give me any hint? – jiluo Nov 18 '12 at 13:48
-
4Just compile the library separately via the command line in the usual way, then add the compiled library and relevant headers to your Xcode project. – Paul R Nov 18 '12 at 13:49
-
1@MartinLuo The typical approach I follow is running the usual `/configure; make` on the library, then I just take the compiled object files and link them together with the object files from my project. Although I don't use Xcode, this is not specific to any IDE, so you can do this. – Nov 18 '12 at 15:08
1 Answers
0
If you have static library then add the same to your Xcode project and compile application. During linking phase library is linked with Application binary and hence no separate installation required for the library.
In case library is dynamic library then check the installation path. If the library installation directory is outside application bundle then you need to create installer to install library to installation directory. On the other hand if installation directory is relative to @excutable path then you can keep the library inside your application bundle and no installation required. You can use copy file phase to copy library into your application bundle.Refer Apple documentation

Raviprakash
- 2,410
- 6
- 34
- 56