Linker error when using incremental builds on iPhone

KostubDeshmukhKostubDeshmukh USMember ✭✭

When I try to build a Debug version on the iPhone and have incremental builds enabled, my build fails with a linker error. This seems to stem from the fact that I -gcc_flags set in additional options.

My other options field says:
-v -v -v -v -gcc_flags "-F${ProjectDir}/Frameworks"

When I build with incremental build on, the ld command line says:

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -dylib -arch arm64 -dylib_install_name @executable_path/libMathChatBinding.dll.dylib -iphoneos_version_min 7.0.0 -read_only_relocs suppress -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -ObjC -o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/MathChatBinding.dll.arm64.dylib /Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.64/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.dylib /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/libMathChatLib.a -framework AVFoundation -framework Accelerate -framework AudioToolbox -framework QuartzCore -framework CoreBluetooth -framework CoreData -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreText -framework EventKit -framework Foundation -framework UIKit -framework GLKit -framework GameController -framework GameKit -framework ImageIO -framework JavaScriptCore -framework MapKit -framework MediaAccessibility -framework MobileCoreServices -framework Security -framework Social -framework SpriteKit -framework StoreKit -framework SystemConfiguration -framework AddressBook -framework Accounts -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework AssetsLibrary -framework CoreTelephony -framework EventKitUI -framework ExternalAccessory -framework CoreMotion -framework iAd -framework MediaPlayer -framework MessageUI -framework NewsstandKit -framework OpenGLES -framework Twitter -framework PassKit -framework MultipeerConnectivity -framework AddressBookUI -framework SafariServices -framework QuickLook -framework AdSupport -framework CFNetwork -framework Fabric -framework TwitterKit -framework ParseCrashReporting -framework ParseUI -framework Crashlytics -framework Parse -framework Appsee -framework Firebase -framework Bolts -framework FacebookSDK -framework ParseFacebookUtils -framework NewRelicAgent -weak_framework AVKit -weak_framework CloudKit -weak_framework SceneKit -weak_framework WebKit -weak_framework LocalAuthentication -weak_framework NetworkExtension -weak_framework HealthKit -weak_framework HomeKit -weak_framework Metal -weak_framework NotificationCenter -weak_framework Photos -weak_framework WatchKit -weak_framework CoreAudioKit -weak_framework PhotosUI -lz -licucore -lc++ -lstdc++.6 -lsqlite3 /var/folders/t1/c3bcv1gs57g5bkj58hwzzd1r0000gn/T/MathChatBinding-fd84cb.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin/libclang_rt.ios.a

When I build without the incremental build option, the command line looks like:

     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch arm64 -iphoneos_version_min 7.0.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -u _mono_pmip -u _xamarin_init_nsthread -u _xamarin_start_wwan -u _xamarin_release_managed_ref -u _xamarin_create_managed_ref -u _xamarin_get_block_descriptor -u _xamarin_IntPtr_objc_msgSend_IntPtr -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr -u _xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32 -u _xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64 -u _xamarin_IntPtr_objc_msgSend_IntPtr_nint_nint_nint_UInt32 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_UInt32 -u _xamarin_IntPtr_objc_msgSend_IntPtr_nint_nint_nint_UInt64 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_UInt64 -u _xamarin_IntPtr_objc_msgSend_IntPtr_UInt32_nint_UInt32 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_UInt32_nint_UInt32 -u _xamarin_IntPtr_objc_msgSend_IntPtr_UInt64_nint_UInt64 -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr_UInt64_nint_UInt64 -u _monotouch_GetFolderPath -u _monotouch_get_locale_country_code -u _monotouch_log -u _monotouch_timezone_get_names -u _monotouch_timezone_get_data -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -u _monotouch_start_wwan -u _mono_profiler_startup_log -ObjC -o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/64/Output/MathChat -lz -licucore -lc++ -lstdc++.6 -lsqlite3 -pie /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/MathChat.exe.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/Xamarin.iOS.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/System.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/System.Xml.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/System.Core.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/Mono.Dynamic.Interpreter.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/MathChatBinding.dll.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/main.arm64.o /Users/kostub/Projects/MathChat/MathChat/obj/iPhone/Debug/mtouch-cache/libMathChatLib.a -framework AVFoundation -framework Accelerate -framework AudioToolbox -framework QuartzCore -framework CoreBluetooth -framework CoreData -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreText -framework EventKit -framework Foundation -framework UIKit -framework GLKit -framework GameController -framework GameKit -framework ImageIO -framework JavaScriptCore -framework MapKit -framework MediaAccessibility -framework MobileCoreServices -framework Security -framework Social -framework SpriteKit -framework StoreKit -framework SystemConfiguration -framework AddressBook -framework Accounts -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework AssetsLibrary -framework CoreTelephony -framework EventKitUI -framework ExternalAccessory -framework CoreMotion -framework iAd -framework MediaPlayer -framework MessageUI -framework NewsstandKit -framework OpenGLES -framework Twitter -framework PassKit -framework MultipeerConnectivity -framework AddressBookUI -framework SafariServices -framework QuickLook -framework AdSupport -framework CFNetwork -framework Fabric -framework TwitterKit -framework ParseCrashReporting -framework ParseUI -framework Crashlytics -framework Parse -framework Appsee -framework Firebase -framework Bolts -framework FacebookSDK -framework ParseFacebookUtils -framework NewRelicAgent -weak_framework AVKit -weak_framework CloudKit -weak_framework SceneKit -weak_framework WebKit -weak_framework LocalAuthentication -weak_framework NetworkExtension -weak_framework HealthKit -weak_framework HomeKit -weak_framework Metal -weak_framework NotificationCenter -weak_framework Photos -weak_framework WatchKit -weak_framework CoreAudioKit -weak_framework PhotosUI -lz -liconv /Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.64/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.a /Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.64/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonotouch-sgen-debug.a /Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.64/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libapp.a /Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.64/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmono-profiler-log.a -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib/darwin/libclang_rt.ios.a -F/Users/kostub/Projects/MathChat/MathChat/Frameworks

Note that in the second command line -F/Users/kostub/Projects/MathChat/MathChat/Frameworks exists while it doesn't in the first one and hence linking fails.

Note: This only happens when I am building for the iPhone. If I build for the iPhoneSimulator the build works fine even when incremental builds are turned on.

Sign In or Register to comment.