Xcode重复符号_main [英] Xcode duplicate symbol _main

查看:65
本文介绍了Xcode重复符号_main的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试编译Appcelerator Titanium生成的任何iPhone应用程序时,在Snow Leopard 10.6.2上的Xcode 3.2.1中都会出现以下错误.但是,仅当我在体系结构菜单上选择iPhone模拟器并且如果选择iPhone设备时,才能够出现构建错误,并且能够在我的设备上运行该应用程序.

I'm getting the following error in Xcode 3.2.1 on Snow Leopard 10.6.2 whenever I try to compile any iPhone application generated by Appcelerator Titanium. However, the build error only appears when I select iPhone simulator on the architecture menu and if I select the iPhone device, I am able to run the app on my device .

此外,iPhone模拟器成功启动并直接从使用Xcode构建的Titanium环境中执行程序.

Further more, the iPhone simulator launches successfully and executes the program directly from the Titanium environment which uses Xcode to build .

为什么会这样?

ld: duplicate symbol _main in Resources/libTitanium.a(main.o) and /Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

ld: duplicate symbol _main in Resources/libTitanium.a(main.o) and /Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

推荐答案

我无法告诉您为什么会这样,但是我可以建议一种解决方法.当我注释掉为我的Titanium项目生成的main.m文件的全部内容时,我能够成功编译并在Simulator上运行.让我知道这是否适合您.

I can't tell you why this is happening, but I can suggest a workaround. When I commented out the entire contents of the main.m file that was generated for my Titanium project, I was able to compile successfully and run on the Simulator. Let me know if that works for you.

这篇关于Xcode重复符号_main的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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