Xcode问题“\u main”

Xcode问题“\u main”,xcode,Xcode,我已经在这个问题上纠缠了一段时间了。无数个小时和时间,我仍然无法理解。我有解决这个问题的办法吗 Ld /Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Products/Debug-iphonesimulator/PumpkinMenace.app/PumpkinMenace normal i386 cd "/Users/alangi

我已经在这个问题上纠缠了一段时间了。无数个小时和时间,我仍然无法理解。我有解决这个问题的办法吗

Ld /Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Products/Debug-iphonesimulator/PumpkinMenace.app/PumpkinMenace normal i386
    cd "/Users/alangibson/GameMaker-Studio/Pumpkin Menace/PumpkinMenace"
    export IPHONEOS_DEPLOYMENT_TARGET=5.1.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Products/Debug-iphonesimulator -L. -LFw -LPumpkinMenace -LFw/iOSSource -LPumpkinMenace/Game -LPumpkinMenace/Supporting\ Files -LFw/iOSSource/Source -LPumpkinMenace/Game/iOSSource -LPumpkinMenace/Supporting\ Files/__MACOSX -LPumpkinMenace/Supporting\ Files/games -LPumpkinMenace/Supporting\ Files/InAppSettings.bundle -LFw/iOSSource/Source/GoogleAdMobAdsSdkiOS-6.8.0 -LPumpkinMenace/Game/iOSSource/Source -LPumpkinMenace/Game/iOSSource/Source/GoogleAdMobAdsSdkiOS-6.8.0 -F/Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Products/Debug-iphonesimulator -F/Users/alangibson/GameMaker-Studio/Pumpkin\ Menace/PumpkinMenace/Fw -F/Users/alangibson/GameMaker-Studio/Pumpkin\ Menace/PumpkinMenace/PumpkinMenace/Supporting\ Files -filelist /Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Intermediates/Pumpkin\ Menace.build/Debug-iphonesimulator/PumpkinMenace.build/Objects-normal/i386/PumpkinMenace.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -objC -all_load -fobjc-arc -stdlib=libstdc++ -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1.1 -liconv -framework CoreMedia -framework SystemConfiguration -framework EventKit -framework EventKitUI -framework CoreTelephony -framework CoreData -framework CoreText -framework StoreKit -framework MapKit -framework AddressBookUI -framework CFNetwork -framework MobileCoreServices -framework Security -lsqlite3.0 -framework AddressBook -framework CoreLocation -framework MessageUI -framework MediaPlayer -framework AudioToolbox -framework GameKit -framework AVFoundation -lz -framework OpenGLES -framework QuartzCore -framework OpenAL -framework UIKit -framework Foundation -framework CoreGraphics -lFlurry -lyoyo_interpreted -framework GameController -framework FacebookSDK -framework AdSupport -framework iAd -lGoogleAdMobAds -Xlinker -dependency_info -Xlinker /Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Intermediates/Pumpkin\ Menace.build/Debug-iphonesimulator/PumpkinMenace.build/Objects-normal/i386/PumpkinMenace_dependency_info.dat -o /Users/alangibson/Library/Developer/Xcode/DerivedData/PumpkinMenace-ddpkivitawzujwdpdfyngakgkyxs/Build/Products/Debug-iphonesimulator/PumpkinMenace.app/PumpkinMenace
这就是错误所在

ld:警告:忽略文件PumpkinMenace/支持文件/libyoyo_解释。a,文件是为存档而生成的,而存档不是链接的体系结构。i386:PumpkinMenace/支持文件/libyoyo_解释。a 架构i386的未定义符号: _main,引用自: 主可执行文件的隐式输入/启动 ld:未找到架构i386的符号 clang:错误:链接器命令失败,退出代码为1使用-v查看调用


是的,每个iPhone项目在Xcode 6.1中都有一个main.m文件,它通常隐藏在项目的Supporting Files文件夹中

如果您没有包含主C风格函数的main.m文件,这就是您看到错误的原因

以下是主要功能的外观:

int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}
架构i386的未定义符号

可能问题出在libyoyo_.a文件中,因为该文件是为ios模拟器架构i386构建的,但您尝试在arm7/armv7/arm64设备上运行应用程序


为arm7/armv7架构重建libyoyo_.a。它对我很有帮助

所以我只需在支持文件中添加一个新文件,然后导入代码?也非常感谢你!