How do I correct the “Undefined symbols for architecture i386: ”_main\" linking issue?

随声附和 提交于 2019-12-01 17:28:22

This suggests that you're not compiling main.m in your project. Make sure of the following:

  • You have a main.m in your project
  • It has a function in it called main()
  • You're actually compiling it. Go to your project, then Build Phases, then Compile Sources. Make sure main.m is in the list.

your code will be compiled for i386 architecture when you use the simulator. If you use a real device your code will be compiled for arm.

i downloaded this project, there is a main.c file inside "other sources" group.

Raphael Rivas

Removing the references to main.ce in your project solve this problem for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!