1

I get the Undefined symbols for architecture i386. Here's what I did:

  1. I checked many times for miswriting .h or .m extensions.

  2. I deleted Framework Search Paths and then wrote ./ being defined as "Recursive" as it was provided as a solution but it did not work either.

  3. Architecture settings is now set as $(ARCHS_STANDARD).

    Undefined symbols for architecture i386:
    "_OBJC_CLASS_$_EMDenemeSinaviCell", referenced from:
         __TFC8EduMobil24EMAssesmentEvaluationNEW9tableViewfS0_FTCSo11UITableView21cellForR        owAtIndexPathCSo11NSIndexPath_CSo15UITableViewCell in         EMAssesmentEvaluationNEW.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
  4. When i change the current Cell Class i am using to another Cell Class it does not give any error. But it gives the following warning:

    file was built for i386 which is not the architecture being linked (x86_64): 
    

How can I solve this error?

Schemetrical
  • 5,506
  • 2
  • 26
  • 43
Daredevil
  • 11
  • 1
  • 7
  • Tried adding this DenemeSinaviCell.m file to Compile Sources under TargetSettings -> Build Phases -> Compile Sources ? Try building and running after that. – Anil May 09 '15 at 08:35
  • Yes, it is there, placed under Compile Sources under Build Phases. – Daredevil May 09 '15 at 08:40
  • Whenever i change the cell type for example EMHomeWorkCell, it works without error. However, when i make the cell type EMDenemeSinaviCell, it is giving this error. i had defined EMDenemeSinaviCell just like EMHomeWorkCell, so it is not supposed to give error, why it gives, idk. – Daredevil May 09 '15 at 08:43
  • i recreated another cell just to be sure about the correction of that EMDenemeSinaviCell class' implementation. (to check if it was about the cell's implementation?), it again failed, gave me same error. – Daredevil May 09 '15 at 08:45
  • Has the "Target Membership" being ticked? Right panel, in the .m file? – Anil May 09 '15 at 09:06
  • yes, i checked now. target membership is ticked as any other .m files in the project. – Daredevil May 09 '15 at 09:12

4 Answers4

1

You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.

To do this:

TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Ru

0

Are you using any frameworks or libraries that don't come from Apple? Sub-projects? This looks like you're using a static or dynamic library that is only available for actual iOS devices or for 64-bit, or only for Mac OS X and trying to build it for the 32-bit iOS simulator (which is 32-bit Intel, hence the "i386").

So I'd guess either you have picked a bad library, or you've selected a 32-bit simulator (e.g. iPhone 4S) but your app is for 64-bit phones/simulator only (e.g. iPhone 6).

PS - Other guess, maybe your Schemes have been screwed up and it's trying to build your iOS project as Mac? What does your scheme selector say for the device? One of your devices? A simulator? "My Mac"?

uliwitness
  • 8,532
  • 36
  • 58
  • I have One project, Two targets. I am using Parse Framework. – Daredevil May 09 '15 at 10:26
  • you said: "you've selected a 32-bit simulator" How can i check this and correct if this was the issue? – Daredevil May 09 '15 at 10:28
  • There's a popup in the upper left of the Xcode window where you select your target and your device/simulator. – uliwitness May 09 '15 at 10:30
  • hmm ok. it says > iPhone 6 – Daredevil May 09 '15 at 10:33
  • Check what architectures your 'Parse' library contains...? (using the 'file' command line tool, or maybe 'lipo'?) Chances are it's i386 and 32-bit iOS only and you need a new version that knows about 64-bit iOS and the 64-bit simulator. – uliwitness May 09 '15 at 10:46
  • thank you but, i want to be sure that you have seen my edit: "When i change the current Cell Class i am using to another Cell Class it does not give any error. But it gives warning" It does not give any error and works fine when i use any older Cell Class for this cell. Was not it supposed to not work with the other Cell Class as well? – Daredevil May 09 '15 at 10:52
0

in Build Settings > "Valid Architectures" remove all unsupported architectures, like i386, x86_64m, etc.

if your architectures will be only {armv7, armv7s, arm64} - it should work. do it in build settings > "Architectures" as well.

yonivav
  • 994
  • 11
  • 18
  • Thanks, in Build Settings > "Valid Architectures" ; there are ---> arm64 armv7 and in "Architectures" ---> $(ARCHS_STANDARD) What should i change? – Daredevil May 10 '15 at 11:51
  • Architectures= 'arm64 armv7'. Hope it will help you. – yonivav May 10 '15 at 13:00
  • "Architectures" ---> $(ARCHS_STANDARD) was shown as 'arm64 armv7' already in my project, Nevertheless i tried as you said, but it did not work like that as well :( – Daredevil May 10 '15 at 19:43
  • did you changed it to 'arm64 armv7' in "Architectures" and also in "Valid Architectures", for your project file (appName.xcodeproj), your target, and for all your sub projects and static libraries (.a or .xcodeproj files) ? if so - i'm sorry but i don't know what's the problem. :( – yonivav May 11 '15 at 08:35
  • Unfortunately i did what you said. It did not work. Thanks again. – Daredevil May 11 '15 at 10:20
0

This solution solved my problem,

https://stackoverflow.com/a/26561570/3924964

The implementation part was missing in Cell file. :(

Community
  • 1
  • 1
Daredevil
  • 11
  • 1
  • 7