Linking an iOS Static Library Project in another Project in Xcode 4.3.2

It took me a while searching on the Internet. Most of the information I found was using the old version of Xcode which has it’s interface changed already. Anyway at the end I figured out a satisfactory way to link a static library project.

Assumption

Some assumptions before the following procedure:

  • You have already created a static library called MyLibrary
  • You are going to use the static library MyLibrary in another iPhone project HelloLibrary
  • You want to link the static library by using project with source code but not binary with header files
  • You already placed your project files in the layout shown in the following screenshot
Folder Layout

Folder Layout

Procedure

  1. Make sure your static library project is not opened by Xcode
  2. Open your HelloLibrary project, drag your static library project MyLibrary into the Project Navigator of the HelloLibrary project.
  3. In your source code, include the header files that you need from the MyLibraryproject. When you compile your project you should receive an error complainting missing header file.

    Project Navigator & Missing Header File Compile Error

    Project Navigator & Missing Header File Compile Error

  4. Now go to your project property page, under the target select HelloLibrary, Build Settings tab, click the All button instead of Basic button under the tab to show all available settings. Scroll down the setting list and look for the section Search Paths. Expand the Header Search Paths item and add the path so that Xcode is able to search the header file from our MyLibrary static library. In our case, the path would be ./Library.

    Configure Header Search Paths

    Configure Header Search Paths

  5. Finally, remember to add the MyLibrary static library in Target Dependencies and Link Binary With Libraries under the Build Phases tab. If you forgotten to do that you will receive a compile error of undefined symbol.

    Edit 2012-07-27: If MyLibrary you are including is using some other frameworks or libraries, for example MessageUI.framework, be sure to include these frameworks and libraries to your project as well! Also, you will need to copy all the related resources such as images used by MyLibrary or else your program will complaint about the missing resources. iOS Library only contains compiled source code and header file.

    Configure Target Dependencies & Link Binary With Libraries

    Configure Target Dependencies & Link Binary With Libraries

    Compile Error - Undefined Symbol

    Compile Error – Undefined Symbol

  6. Finally you should be able to compile your HelloLibrary without an error!

Enabling “Clean Solution” Option in Visual Basic 2010 Express

  1. Under the Tools menu, go to the submenu Settings and switch to Expert Settings. The Build menu should be available by now, but Clean Solution menu item is still missing.
    Switch to "Expert Settings"

    Expert Settings

    Build Menu

    Build Menu

  2. Under the Debug menu, click Options and Settings.

    "Options and Settings" Menu Item

    "Options and Settings" Menu Item

  3. Under Project and Solutions item, inside the General item, check the check box for Always show solution. Press OKto exit.

    "Always show solution" Option

    "Always show solution" Option

  4. In the Build menu again, the Clean Solutionmenu item should be there finally.

    "Clean Solution" Menu Item

    "Clean Solution" Menu Item

Fixing Internet Connection Sharing (ICS) DHCP not Working

Problem

ICS on Windows XP has been enabled, however some Ethernet devices disable and cable plugging in and out has cause the ICS DHCP function is not working properly and no IP is able to assigned to the connected machines.

Solution

After searching on the Internet, I found executing the following command on the ICS enabled PC would fix the problem:

netsh winsock reset

Do remember to restart the ICS enabled PC afterwards!

Enabling MS SQL Remote Access

By default, MS SQL does not enable remote access after a clean install. To enable this:

  1. Launch Sql Server Configuration Manager

    Sql Server Configuration Manager

    Sql Server Configuration Manager

  2. Double click TCP/IP, in the Protocol tab under the General section, set the Enabled to Yes.
  3. In the IP Addresses tab, scroll to the button. In the IPAll section assign the port to TCP Port. To use MS SQL default port, assign it to 1433.

    TCP/IP Properties

  4. Finally, remember to set the firewall to allow the incoming TCP connection.

    Windows Firewall with Advanced Security