如何更正“架构 i386 的未定义符号:“_main”链接问题?
我正在尝试使用苹果提供的 KeyChainitemwrapper 。我的项目正在使用 ARC,但我已经在 KeyChainitemwrapper.m 上关闭了 ARC。我将“security.framework”框架链接到我的项目。
我遇到这个链接问题:
架构 i386 的未定义符号: “_main”,引用自: 从 crt1.10.6.o 开始 ld:未找到架构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
我是 ios 开发新手,但我的猜测是问题与模拟器试图编译我的目标 i386 的源代码有关比手臂??我很接近吗?
不管怎样..看来这个包装器相当受欢迎,所以我想知道熟悉这个问题的人是否可以帮忙。
谢谢
I am trying to use the KeyChainitemwrapper provided by apple. My project is using ARC but I have turned of ARC on KeyChainitemwrapper.m. I linked the 'security.framework' framework to my project.
I am getting this linking issue:
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am new to ios development but my guess is that the problem has to do with the fact that the simulator is trying to compile my source targeting i386 rather than arm?? Am I close?
Anyways.. it appears that this wrapper is fairly popular so I was wondering if someone who might be familiar with this problem could lend a hand.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这表明您没有在项目中编译
main.m
。确保以下几点:main.m
main()
的函数main.m
在列表中。This suggests that you're not compiling
main.m
in your project. Make sure of the following:main.m
in your projectmain()
main.m
is in the list.当您使用模拟器时,您的代码将针对 i386 架构进行编译。
如果您使用真实设备,您的代码将为arm编译。
我下载了这个项目,“其他来源”组中有一个 main.c 文件。
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.
删除项目中对 main.ce 的引用为我解决了这个问题
Removing the references to main.ce in your project solve this problem for me