Xcode Issue "_main" - xcode

I have been stuck on this problem for awhile now. Countless hours and time and I still can't figure it out. Is there a solution to this problem that I have?
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
This is the Error
ld: warning: ignoring file PumpkinMenace/Supporting Files/libyoyo_interpreted.a, file was built for archive which is not the architecture being linked (i386): PumpkinMenace/Supporting Files/libyoyo_interpreted.a
Undefined symbols for architecture i386:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Yes, every iPhone project has a "main.m" file (in Xcode 6.1, it's usually hiding in the "Supporting Files" folder of your project).
If you don't have that main.m file (which contains a main C-style function), that's why you are seeing the error you are seeing.
Here is what the main function looks like:
int main(int argc, char * argv[]) {
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

"Undefined symbols for architecture i386"
maybe the problem is in libyoyo_interpreted.a file because it was built for ios simulator architecture (i386), but you attempt to run application on device (which is arm7/armv7/arm64).
Rebuild libyoyo_interpreted.a for arm7/armv7 architectures. (it helped to me http://blog.diogot.com/blog/2013/09/18/static-libs-with-support-to-ios-5-and-arm64/)

Related

ld: 3 duplicate symbols for architecture i386

while trying to run in Xcode 7.3.1, I am getting the following error :
Ld /Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/birdybobble\ iOS.app/birdybobble\ iOS normal i386
cd /Volumes/WORK/birdybobble/proj.ios_mac
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/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/iPhoneSimulator9.3.sdk -L/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator -Lsdkbox.framework -LPluginChartboost.framework -LChartboost.framework -LPluginAdMob.framework -LGoogleMobileAds.framework -LPluginIAP.framework -F/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator -F/Volumes/WORK/birdybobble/proj.ios_mac -filelist /Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Intermediates/birdybobble.build/Debug-iphonesimulator/birdybobble\ iOS.build/Objects-normal/i386/birdybobble\ iOS.LinkFileList -mios-simulator-version-min=8.0 -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -ObjC -stdlib=libc++ -fobjc-link-runtime -lbz2.1.0 -lz.1 -framework OpenGLES -framework UIKit -framework CoreMotion -framework Security /Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/libcocos2d\ iOS.a -framework Foundation -framework CoreGraphics -framework QuartzCore -framework OpenAL -framework AVFoundation -framework AudioToolbox -framework sdkbox -framework PluginChartboost -framework Chartboost -framework StoreKit -framework AdSupport -framework SystemConfiguration -framework PluginAdMob -framework GoogleMobileAds -framework CoreMedia -framework CoreTelephony -framework EventKit -framework EventKitUI -framework MessageUI -framework GameController -framework MediaPlayer -framework PluginIAP -Xlinker -dependency_info -Xlinker /Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Intermediates/birdybobble.build/Debug-iphonesimulator/birdybobble\ iOS.build/Objects-normal/i386/birdybobble\ iOS_dependency_info.dat -o /Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/birdybobble\ iOS.app/birdybobble\ iOS
duplicate symbol _strerror$UNIX2003 in:
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Intermediates/birdybobble.build/Debug-iphonesimulator/birdybobble iOS.build/Objects-normal/i386/asd.o
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/libcocos2d iOS.a(CCImage.o)
duplicate symbol _fopen$UNIX2003 in:
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Intermediates/birdybobble.build/Debug-iphonesimulator/birdybobble iOS.build/Objects-normal/i386/asd.o
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/libcocos2d iOS.a(CCImage.o)
duplicate symbol _fwrite$UNIX2003 in:
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Intermediates/birdybobble.build/Debug-iphonesimulator/birdybobble iOS.build/Objects-normal/i386/asd.o
/Users/ecdev/Library/Developer/Xcode/DerivedData/birdybobble-hfiarbprydmxgtbmjresfgzerqom/Build/Products/Debug-iphonesimulator/libcocos2d iOS.a(CCImage.o)
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If someone can help, it will be a great help !!!
Thanks in advance.
From Xcode 7.3 onwards you can you can's use any custom variable twice. If you want to use then just Go to Build Setting and search for No Common Blocks and set it NO. And build again you will not get this error again.

Xcode ld: library not found for. Can't figure out the one last missing

Hi
I'm facing some of the library not found error after I move my project from one computer to another. I was able to fix most of them by retyping the library search path in build setting, but there are one last one that I can't figure out...
Does anyone have any idea how to fix this? Here is the screenshot off the full error.
"Ld /Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Products/summer.app/summer normal armv7
cd /Users/Garett/Desktop/summer
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Products -LSocialNetworking -LSocialNetworking/FacebookSDK -LSocialNetworking/Twitter -LPrime31Shared -L/Users/Garett/Desktop -L/Volumes/xyz.archive/WHEELBARROW/W1301.01.SHAUNTAN.SummerEBook/proto/Libraries -L/Users/Garett/Desktop/summer/Prime31Shared -L/Users/Garett/Desktop/summer/SocialNetworking/FacebookSDK -L/Users/Garett/Desktop/summer/SocialNetworking/Twitter -L/Volumes/xyz.archive/WHEELBARROW/W1301.01.SHAUNTAN.SummerEBook/proto -L/Users/Garett/Desktop/summer/Libraries -L/Users/Garett/Desktop/summer/Libraries -F/Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Products -filelist /Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/summer.LinkFileList -dead_strip -all_load -weak_framework CoreMotion -weak-lSystem -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -framework AudioToolbox -framework CFNetwork -liPhone-lib -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -lP31SharedTools -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -weak_framework GameKit -weak_framework MessageUI -lz.1.1.3 -lP31Twitter -weak_framework AdSupport -weak_framework Accounts -weak_framework Social -lfacebook_ios_sdk -weak_framework Twitter -framework Security -lsqlite3.0 -Xlinker -dependency_info -Xlinker /Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/summer_dependency_info.dat -o /Users/Garett/Library/Developer/Xcode/DerivedData/Unity-iPhone-hersobsdbotryocyyleucivbibaa/Build/Products/summer.app/summer"
ld: library not found for -liPhone-lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thx

Trouble using CocoaPods in project

I'm new to IOS Development and I'm trying to Restkit via cocoapods using this tutorial with no success. I'm getting the following error:
Ld /Users/noor/Library/Developer/Xcode/DerivedData/EZ-POINT-cltwbuksnzhbqpabqekhgkzqspjw/Build/Products/Debug-iphonesimulator/EZ-POINT.app/EZ-POINT normal i386
cd /Users/noor/Documents/Apps/EZ-POINT.BK
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv 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/iPhoneSimulator6.1.sdk -L/Users/noor/Library/Developer/Xcode/DerivedData/EZ-POINT-cltwbuksnzhbqpabqekhgkzqspjw/Build/Products/Debug-iphonesimulator -F/Users/noor/Library/Developer/Xcode/DerivedData/EZ-POINT-cltwbuksnzhbqpabqekhgkzqspjw/Build/Products/Debug-iphonesimulator -filelist /Users/noor/Library/Developer/Xcode/DerivedData/EZ-POINT-cltwbuksnzhbqpabqekhgkzqspjw/Build/Intermediates/EZ-POINT.build/Debug-iphonesimulator/EZ-POINT.build/Objects-normal/i386/EZ-POINT.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework CFNetwork -framework CoreData -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreLocation -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -lPods -o /Users/noor/Library/Developer/Xcode/DerivedData/EZ-POINT-cltwbuksnzhbqpabqekhgkzqspjw/Build/Products/Debug-iphonesimulator/EZ-POINT.app/EZ-POINT
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestion?
You should open your project by .xcworkspace not by .xproject :-)
Besides, I find this one might help you solve your problem
You should read this, you need a workspace, not a project http://docs.cocoapods.org/guides/integrating_a_project.html

Xcode Linker Error?

I get this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GameCenterManager", referenced from:
objc-class-ref in BT_viewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Info:
Ld /Users/Raoul/Library/Developer/Xcode/DerivedData/latintogopro-fbrntyvxhakjwlfaxcckdbvsvcli/Build/Products/Debug-iphonesimulator/LatinToGo.app/LatinToGo normal i386
cd /Users/Raoul/Downloads/latintogopro_v15_iOS
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv 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/iPhoneSimulator5.0.sdk -L/Users/Raoul/Library/Developer/Xcode/DerivedData/latintogopro-fbrntyvxhakjwlfaxcckdbvsvcli/Build/Products/Debug-iphonesimulator -L/Users/Raoul/Downloads/latintogopro_v15_iOS/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine -F/Users/Raoul/Library/Developer/Xcode/DerivedData/latintogopro-fbrntyvxhakjwlfaxcckdbvsvcli/Build/Products/Debug-iphonesimulator -F/Users/Raoul/Downloads/latintogopro_v15_iOS/BT_Objects -filelist /Users/Raoul/Library/Developer/Xcode/DerivedData/latintogopro-fbrntyvxhakjwlfaxcckdbvsvcli/Build/Intermediates/latintogopro.build/Debug-iphonesimulator/latintogopro.build/Objects-normal/i386/LatinToGo.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework Security -framework GameKit -lxml2.2 -framework CoreAudio -framework CoreLocation -framework Foundation -framework SystemConfiguration -weak_framework UIKit -framework MobileCoreServices -framework AVFoundation -weak_framework MessageUI -lOAuth -framework MapKit -weak_framework MediaPlayer -framework CoreGraphics -framework QuartzCore -weak_framework iAd -o /Users/Raoul/Library/Developer/Xcode/DerivedData/latintogopro-fbrntyvxhakjwlfaxcckdbvsvcli/Build/Products/Debug-iphonesimulator/LatinToGo.app/LatinToGo
Go to your project, click on Build phases, Compile sources, Add GameCenterManager.m to the list.
Hope this will help :)
Presumably your code refers to the class called GameCenterManager but your project doesn't link to the framework that defines it.
If this is a built-in framework, then link to that framework: edit the target, in the Summary scroll down to the linked frameworks, press the Plus button to add the framework.
If this is a third-party framework, they should provide instructions for linking to their framework.

Apple Mach-O Librarian (libtool) error with no specific error

I've had to deal with plenty of libtool errors previously, but I really don't know what to do with one that doesn't give me a hint.
Here is the full error:
Libtool /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libRZFramework.a normal armv7
cd /Users/programmingstation7/Documents/CleanedFramework
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool -static -arch_only armv7 -syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos -L/Users/programmingstation7/Documents/CleanedFramework/.. -filelist /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Intermediates/RZFramework.build/Debug-iphoneos/RZFramework.build/Objects-normal/armv7/RZFramework.LinkFileList -lxml2 -ObjC -all_load -framework CoreData /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libarc.a /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libEISRenderHelpful.a -framework CFNetwork -framework MobileCoreServices -framework Security /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libxml2.dylib /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libz.dylib -framework CoreLocation -framework CoreText -framework UIKit -framework Foundation -framework CoreGraphics -framework MediaPlayer -framework QuartzCore -framework AVFoundation -framework OpenGLES -framework MapKit -framework MessageUI -framework SystemConfiguration -framework EventKit -framework EventKitUI -o /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libRZFramework.a
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool failed with exit code 1
I'm using the linker flags -lxml2 -ObjC -all_load
Any ideas as to what causes a exception-less libtool failure?
Oh, and I'm building a static library target. Previously, this was an app and I tore out all the unreusable stuff for the beginning of an app framework I'll be able to use.
I've had exactly the same problem yesterday and I found the solution.
remove the -lxml2 from your other linker flags.
It makes libtool link the library statically which causes problems.

Resources