0

I created new data model and then added 2 entities (Person, Address), but could not compile with "Linker command failed with exit code 1". Why does it occur like this ? I don't know the cause.

when the entities are deleted, build succeeded.

please let me know how to remove this error.

Ver: Xcode 8.3 Lang: Objective-c

Junk
  • 1
  • You need to include more information, there must be a more detailed error description available from xcode. The linker did not only emit the error code 1, it also wrote why it failed. – DusteD Jul 17 '17 at 06:55
  • Thanks your quick reply. I can't find more detailed error description. I'm sorry. I'm still beginner – Junk Jul 17 '17 at 07:01
  • Can you add screenshot of the error. Since its compile time error, you will have more info below it. – Kapil G Jul 17 '17 at 07:14
  • I'm sorry. I don't know how to post it here. I uploaded these images on my git hub. https://github.com/Junya-Kitayama/Image – Junk Jul 17 '17 at 07:53

1 Answers1

1

Linker error means that although your source files have been compiled correctly, but failed to link with other frameworks (system frameworks, or 3rd party ones), clang cannot find them in place.

Check this answer, it may help you.

Go to build phases -> Make sure all .m files are listed in compile sources list

Also , Try clearing all derivied data -> Clean -> Quit Xcode -> Restart -> Run Again

Also make sure you didn't imported a .m file instead of .h file anywhere

Amal T S
  • 3,327
  • 2
  • 24
  • 57
  • I check it out but all (.m) files and data model are correctly reflected. is there something else I should check ? – Junk Jul 17 '17 at 07:11
  • Try clearing all derivied data -> Clean -> Quit Xcode -> Restart -> Run Again – Amal T S Jul 17 '17 at 07:13
  • Also make sure you didn't imported a **.m** file instead of **.h** file anywhere – Amal T S Jul 17 '17 at 07:15
  • I did it as you said, but it didn't resolve. here is screenshots of error. https://github.com/Junya-Kitayama/Image can you identify the cause ? – Junk Jul 17 '17 at 08:08