Like many others here SO, I am having issues using libraries in my XCode workspace. The idea is I have my main project (MyApp
) and two libraries (lib1
Here is how to create a static library and a project that use it.
Step 1: Create a workspace: File > New > Workspace. This is not mandatory but it helps organize the projects.
Step 2: Create a static library project: File > New > Project > Framework and Library > Cocoa Touch Static Library. Lets call it MyLib.
Step 3: Create an Application Project: File > New > Project > Application> Empty Application, or any other application template. Lets call this project MyApp. If you placed the projects in different folders, you may have to use a different path.
Now you have the following Projects in the workspace.
Step 4: Configure the app so that it finds the .h
files of the library. To do that, add the parent folder "../" and check the recursive checkbox.
Step 5: Link the app to the library.