Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Common Causes</h3> <p>The common causes for "Undefined symbols for architecture armv7" are:</p> <ol> <li><p>You <strong>import a header and do not link against the correct library</strong>. This is common, especially for headers for libraries like QuartzCore since it is not included in projects by default. To resolve:</p> <ul> <li><p>Add the correct libraries in the <strong><em><code>Link Binary With Libraries</code></em></strong> section of the <strong><em><code>Build Phases</code></em>.</strong></p></li> <li><p>If you want to add a library outside of the default search path you can include the path in the <strong><em><code>Library Search Paths</code></em></strong> value in the Build Settings and add <br/><code>-l{library_name_without_lib_and_suffix}</code> (eg. for libz.a use <code>-lz</code>) to the <strong><em><code>Other Linker Flags</code></em></strong> section of <strong><em><code>Build Settings</code></em></strong>.<br/><br/></p></li> </ul></li> <li><p>You <strong>copy files into your project but forgot to check the target to add the files to</strong>. To resolve:</p> <ul> <li>Open the <strong><em><code>Build Phases</code></em></strong> for the correct target, expand <strong><em><code>Compile Sources</code></em></strong> and add the missing <code>.m</code> files. If this is your issue please upvote <a href="https://stackoverflow.com/a/10170293/418715">Cortex's answer below</a> as well.<br/><br/></li> </ul></li> <li><p>You <strong>include a static library that is built for another architecture</strong> like i386, the simulator on your host machine. To resolve:</p> <ul> <li><p>If you have multiple library files from your libraries vendor to include in the project you need to include the one for the simulator (i386) and the one for the device (armv7 for example).</p></li> <li><p>Optionally, you could create a <a href="https://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4">fat static library</a> that contains both architectures.</p></li> </ul></li> </ol> <p><br/></p> <hr> <h3>Original Answer:</h3> <p>You have not linked against the correct libz file. If you right click the file and reveal in finder its path should be somewhere in an iOS sdk folder. Here is mine for example</p> <blockquote> <p>/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib</p> </blockquote> <p>I recommend removing the reference and then re-adding it back in the Link Binary With Libraries section Build Phases of your target.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload