如何修复此重复符号错误?

发布于 2025-01-04 13:52:57 字数 673 浏览 1 评论 0原文

从我收到的错误中:

ld: duplicate symbol _main in /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/fmdb.o and /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/main.o for architecture i386

我无法弄清楚为什么会发生此错误。我只是更改了项目中的一些框架文件,现在这个错误不会消失!它显然说 _main 正在被重复,但我不知道在哪里,或者为什么?

是什么原因造成的?

From the error I am getting:

ld: duplicate symbol _main in /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/fmdb.o and /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/main.o for architecture i386

I can't figure out why this error is occurring. I simply changed some framework files in my project and now this error won't go away! It obviously says _main is being duplicated, but I dont know where, or why?

What is causing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

站稳脚跟 2025-01-11 13:52:57

您需要查看 main.m/.h 和 fmdb.m/.h 文件。最有可能的是,他们都在导入定义 _main 的东西,也许是在全局级别。通常这就是为我生成此错误的原因。

You need to look at the main.m/.h and fmdb.m/.h files. What is most likely is that they are both importing something that defines _main, perhaps at a global level. Usually thats the sort of thing that generates this error for me.

吹梦到西洲 2025-01-11 13:52:57

您的代码中有两个 main 函数。对 main 进行全局搜索并删除您不需要的。

当您将其他项目的文件添加到您的项目而不删除 main 函数时,就会发生这种情况。

You have two main function in your code. Do a global search for main and remove the one you don't want.

It happens when you add some other project's files to your project without remove the main function.

趁年轻赶紧闹 2025-01-11 13:52:57

听起来您在“目标/编译源”下有多个条目。检查并删除它们。

Sounds like you have multiple entries under Targets/Compiled Sources. Check and remove them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文