Xcode重复符号_main [英] Xcode duplicate symbol _main
问题描述
每当我尝试编译由 Appcelerator的Titanium 。但是,只有在我在架构菜单上选择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's Titanium . However , the build error only appears when I select iPhone simulator on the architecture menu , and if I select iPhone device , I am able to run the app on my device .
此外,iPhone模拟器成功启动并直接从Titanium环境执行程序,该环境使用Xcode进行构建。
Further , the iPhone simulator launches successfully and executes the program directly from the Titanium environment , which uses Xcode to build .
为什么会发生这种情况?
Why is this happening ?
ld:Resources / libTitanium中的重复符号_main .a(main.o)和/Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o
collect2:ld返回1退出状态
命令/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2失败,退出代码为1
推荐答案
我不能告诉你为什么会这样,但我可以建议一个解决方法。当我注释掉为我的Titanium项目生成的main.m文件的全部内容时,我能够成功编译并在模拟器上运行。如果这对您有用,请告诉我。
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屋!