Wednesday, July 13, 2011

How to build c-ares library in Xcode

- Download the latest version of c-ares library on a Mac and unzip it.
- Open the terminal and go to the source file directory.
- Execute ./configure and it will create ares_config.h file.

- Now open a new project in Xcode. I created a Library project for iPhone OS category and named it 'cares'.
- Right click on 'Classes' and select Add -> Existing Files. A file dialog box will appear. Select and add the source file directory. The source codes will be added to the project.
- Right click on the project and select 'Get Info'. Under 'Build' tab, write 'flags' in the search box. You will see an entry named "Other C Flags". Add value -DHAVE_CONFIG_H for it.

Now c-ares library should be built in Xcode without any error.

No comments:

Post a Comment