Xcode 4-clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) [英] Xcode 4 - clang: error: linker command failed with exit code 1 (use -v to see invocation)

查看:102
本文介绍了Xcode 4-clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建我的项目时,我不断收到以下错误.我在Google上进行了搜索,发现有些人的类间变量具有相同的名称,并且/或者忘记了在Linker中包含/包含某些类的多个包含物,但对我而言并非如此.

I keep getting the following error when trying to Build my project. I did a Google search and found some folks who had the same name for their variables between classes and/or forgot to include/had multiple inclusions of some classes in their Linker, but this is not the case for me.

请参见下图:

推荐答案

正如错误所述,它找不到main函数.通常,在iOS项目中,此功能随模板提供,如下所示:

As it says in the error it can't find the main function. Normally in an iOS Project this function comes with the template and looks something like this:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

之所以需要它,是因为main函数是每个C,C ++和Objective-C程序的入口.它位于 Supporting Files 组的一个名为main.m的文件中(这并不意味着您不能将其移动到其他位置).

It is needed because the main function is the entrance point for every C, C++ and Objective-C program. It is located in a file called main.m in the Supporting Files group (which doesn't mean you're not allowed to move it elsewhere).

要解决此错误,请查看文件/功能是否存在.如果是这样,请打开实用程序窗格(右侧),转到第一个选项卡,查看是否选中了目标的复选框.

To fix this error, look if the file/the function exists. If they do, open the utilities pane (the right one), go to the first tab and look if the checkbox of the target is selected.

这篇关于Xcode 4-clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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