如何更正“架构i386的未定义符号:”_ main“链接问题? [英] How do I correct the "Undefined symbols for architecture i386: "_main" linking issue?

查看:100
本文介绍了如何更正“架构i386的未定义符号:”_ main“链接问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用apple提供的KeyChainitemwrapper。我的项目正在使用ARC,但我已经在KeyChainitemwrapper.m上使用了ARC。我将'security.framework'框架链接到我的项目。

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:


架构i386的未定义符号:
_ main,引自:
start in crt1.10.6.o
ld:symbol(s)not found for architecture i386
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

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)

我是新手ios开发但我的猜测是问题与模拟器试图编译我的源i386而不是手臂的事实有关?我关闭了吗?

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.

谢谢

推荐答案

这表明你没有编译<$ c项目中$ c> main.m 。确保以下内容:

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


  • 您的项目中有 main.m

  • 它有一个函数叫做 main()

  • 你实际上在编译它。转到您的项目,然后构建阶段,然后编译源。确保 main.m 在列表中。

  • 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.

这篇关于如何更正“架构i386的未定义符号:”_ main“链接问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆