EDIT (22/06-21): I went thru all my nugets one by one and found that the extra mtouch args. comes from the Xamarin.Firebase.iOS nugets. Someone over there has made the lib. so that it append some global mtouch flags. (the current stable version appends "-ObjC -lc++ -lsqlite3 -lz")
Since it dont seem to help to open an issue over there i must somehow make my lib. work with those flags. great...
I have a weird problem with building a ios forms app.
We have made a dll of a native library (openCV2) with some functions we need.
we have made a PoC that builds and runs just fine, but when we take it to the "real" app it cant build.
right before the build fails i see in the log:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch #/Users/xxx/Library/Caches/Xamarin/mtbs/builds/xxx.iOS/xxxx/obj/iPhone/Debug/device-builds/iphone11.2-14.6/response-file.rsp -v -v -v -v --gcc_flags=-ObjC
while on the PoC app the same line is:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch #/Users/xxx/Library/Caches/Xamarin/mtbs/builds/xxx.iOS/xxxx/obj/iPhone/Debug/device-builds/iphone11.2-14.6/response-file.rsp
i know the "-v -v -v -v" is from my additional mtouch args. but no where (that i can find) is the gcc_flags set and i cant find a way to remove it.
what i have tried with no luck:
linking Foundation framework in the additional mtouch args. linking
Foundation framework in the LinkWithAttribues.cs file in the binding
project none, sdk-only and all linking. looked at diffrenses in the
project files made all the changes i can think of in the LinkWith
file eg. linker flags, smart linking c++ and the like. tried with and
w/o this linker flag L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Wl,-rpath -Wl,#executable_path/Frameworks
made sure the code in the implementation and PoC is 100% the same
made the iOS build options 100% the same in project and PoC
installed the xamarin.swift nuget
tried both 4.8 and 5.0 xamarin forms
im running
vs for mac 8.10 (for binding project)
vs2019 16.10.1 (for app building)
xamarin.ios 14.19 on both
does anyone have a idea on what is going wrong here?
Im at the end of my rope, any help or ideas on where to look would be greatly appricieted.
here is the complete "failing" build log:
1> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch #/Users/appteam/Library/Caches/Xamarin/mtbs/builds/xxx.iOS/xxx/obj/iPhone/Debug/device-builds/iphone11.2-14.6/response-file.rsp -v -v -v -v --gcc_flags=-ObjC
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): warning : Could not find or use auto-linked library 'swiftObjectiveC'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): warning : Could not find or use auto-linked library 'swiftCore'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): warning : Could not find or use auto-linked library 'swiftQuartzCore'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftObjectiveC'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCore'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftQuartzCore'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftos'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreGraphics'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftDarwin'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreFoundation'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCompatibility50'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftDispatch'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftAVFoundation'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreMedia'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftAccelerate'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftFoundation'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftsimd'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreImage'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreAudio'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftUIKit'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftCoreMIDI'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : warning: Could not find or use auto-linked library 'swiftMetal'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Foundation.DataProtocol.copyBytes(to: Swift.UnsafeMutableRawBufferPointer) -> Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Foundation.__DataStorage.init(bytes: Swift.UnsafeRawPointer?, length: Swift.Int) -> Foundation.__DataStorage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata accessor for Foundation.__DataStorage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata accessor for Foundation.Data.RangeReference. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Foundation.Data._bridgeToObjectiveC() -> __C.NSData. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static Foundation.Data._unconditionallyBridgeFromObjectiveC(__C.NSData?) -> Foundation.Data. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol conformance descriptor for Foundation.Data : Foundation.DataProtocol in Foundation. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata for Foundation.Data. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: associated type descriptor for Swift.Sequence.Element. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: associated type descriptor for Swift.IteratorProtocol.Element. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: associated type descriptor for Swift.Sequence.Iterator. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: associated type descriptor for Swift.RawRepresentable.RawValue. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Swift.Dictionary._bridgeToObjectiveC() -> __C.NSDictionary. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Hashable._rawHashValue(seed: Swift.Int) -> Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Hashable.hash(into: inout Swift.Hasher) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Hashable.hashValue.getter : Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol descriptor for Swift.Hashable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: base conformance descriptor for Swift.Hashable: Swift.Equatable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for static Swift.Equatable.== infix(A, A) -> Swift.Bool. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol descriptor for Swift.Equatable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift.String.hash(into: inout Swift.Hasher) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift.String.write<A where A: Swift.TextOutputStream>(to: inout A) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata for Swift.String. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol witness table for Swift.String : Swift.Hashable in Swift. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence.makeIterator() -> A.Iterator. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A.Element>) -> (A.Iterator, Swift.Int). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence.underestimatedCount.getter : Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence._copyToContiguousArray() -> Swift.ContiguousArray<A.Element>. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence._customContainsEquatableElement(A.Element) -> Swift.Bool?. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.Sequence.withContiguousStorageIfAvailable<A>((Swift.UnsafeBufferPointer<A.Element>) throws -> A1) throws -> A1?. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: associated conformance descriptor for Swift.Sequence.Swift.Sequence.Iterator: Swift.IteratorProtocol. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol descriptor for Swift.Sequence. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Swift):Swift.Sequence.withContiguousStorageIfAvailable<A>((Swift.UnsafeBufferPointer<A.Element>) throws -> A1) throws -> A1?. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.RawRepresentable.rawValue.getter : A.RawValue. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.RawRepresentable.init(rawValue: A.RawValue) -> A?. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol descriptor for Swift.RawRepresentable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Swift.Array._bridgeToObjectiveC() -> __C.NSArray. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static (extension in Foundation):Swift.Array._unconditionallyBridgeFromObjectiveC(__C.NSArray?) -> [A]. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static Swift.Array._allocateBufferUninitialized(minimumCapacity: Swift.Int) -> Swift._ArrayBuffer<A>. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Foundation):Swift.Double._bridgeToObjectiveC() -> __C.NSNumber. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static (extension in Foundation):Swift.Double._forceBridgeFromObjectiveC(_: __C.NSNumber, result: inout Swift.Double?) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata for Swift.Double. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata for Swift.Float. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift.Int.hashValue.getter : Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata for Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol conformance descriptor for Swift.Int : Swift.BinaryInteger in Swift. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: method descriptor for Swift.IteratorProtocol.next() -> A.Element?. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol descriptor for Swift.IteratorProtocol. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Swift):Swift.BinaryInteger.description.getter : Swift.String. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift._StringGuts.grow(Swift.Int) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata accessor for Swift._ArrayBuffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: protocol conformance descriptor for Swift._ArrayBuffer<A> : Swift._ArrayBufferProtocol in Swift. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift._CocoaArrayWrapper.endIndex.getter : Swift.Int. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: Swift._CocoaArrayWrapper.subscript.getter : (Swift.Int) -> Swift.AnyObject. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: static Swift._DictionaryStorage.allocate(capacity: Swift.Int) -> Swift._DictionaryStorage<A, B>. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: type metadata accessor for Swift._DictionaryStorage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error MT5210: Native linking failed, undefined symbol: (extension in Swift):Swift._ArrayBufferProtocol._outlinedMakeUniqueBuffer(bufferCount: Swift.Int) -> (). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
(... shortend ...)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(380,3): error : linker command failed with exit code 1 (use -v to see invocation)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Can you please check changing the Linker Behavior to "Link Framework SDKs only" :
I want to be able to capture input from the Fn and Eject keys on my Apple magic keyboard when using it with a Windows 10 machine. To do this, I came across an open source driver called WinAppleKey (https://github.com/samartzidis/WinAppleKey). The readme mentions a setup.msi file, which I could not locate in the repo after downloading it. So how do I actually install the driver?
I've tried running the WinAppleKey.sln file, which has not worked out despite having the latest versions of the WDK and SDK because of the following errors:
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "SLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 16389
Error (active) E0035 #error directive: "No target architecture defined" WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntddk.h 9103
Error (active) E0020 identifier "PDRIVER_EXCPTN_CALLBACK" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntddk.h 13802
Error (active) E0020 identifier "PCMC_EXCEPTION" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntddk.h 13879
Error (active) E0020 identifier "PCPE_EXCEPTION" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntddk.h 13890
Error (active) E0020 identifier "SLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 16409
Error (active) E0035 #error directive: "No target architecture defined" WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 20679
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 23818
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 23887
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 23988
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 23994
Error (active) E0020 identifier "PFN_NUMBER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 27128
Error (active) E0035 #error directive: "No Target Architecture" WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\ntdef.h 201
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 24001
Error (active) E0020 identifier "PSLIST_HEADER" is undefined WinAppleKey C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\wdm.h 23901
You may of already found it, but the setup.msi file is in the release files of the project and not the code source.
Here's where you can download it from : https://github.com/samartzidis/WinAppleKey/releases/tag/v1.0.9
You will just have to click on setup.msi to download it onto your PC.
The application is ready for Xamarin IOS.
Yesterday there was no problem. I did visual studio update for hot restart to 16.7.3.
Today when I turn it on, I am remote to the mac, but when I say build, I get linking failed errors like the following, about 33.
I haven't installed any nuget packages etc.
It took me a day to undo the last changes I made.
It builds when not connected to the Mac but when I connect to the mac I get these errors anyway.
I can't figure it out. Can you help me?
This is the project output while building:
2> takikuyumculuk.iOS -> C:\Users\Onur\source\repos\takikuyumculuk\takikuyumculuk\takikuyumculuk.iOS\bin\iPhoneSimulator\Release\takikuyumculuk.iOS.exe
2> Detected signing identity:
2>
2> Bundle Id: com.takikuyumculuk.apple
2> App Id: com.takikuyumculuk.apple
2> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch #/Users/takikuyumculuk/Library/Caches/Xamarin/mtbs/builds/takikuyumculuk.iOS/9d7e2ac1ac9741d6ee40a3186654ad40/obj/iPhoneSimulator/Release/response-file.rsp "--gcc_flags=-ObjC -lc++ -lsqlite3 -lz"
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULIsLoggableLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULLogBasic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULLogError. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULLogInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULLogWarning. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _GULSetLoggerLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5211: Native linking failed, undefined Objective-C class: GULAppDelegateSwizzler. The symbol '_OBJC_CLASS_$_GULAppDelegateSwizzler' could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5211: Native linking failed, undefined Objective-C class: GULAppEnvironmentUtil. The symbol '_OBJC_CLASS_$_GULAppEnvironmentUtil' could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5211: Native linking failed, undefined Objective-C class: GULMutableDictionary. The symbol '_OBJC_CLASS_$_GULMutableDictionary' could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5211: Native linking failed, undefined Objective-C class: GULNetwork. The symbol '_OBJC_CLASS_$_GULNetwork' could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5211: Native linking failed, undefined Objective-C class: GULSwizzler. The symbol '_OBJC_CLASS_$_GULSwizzler' could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeCannotAcceptTraffic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotFound. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotModified. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeUnavailable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusNoContent. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _kGULNetworkHTTPStatusOK. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_decode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_decode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_encode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_encode_string. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_encode_submessage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_encode_tag_for_field. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_encode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_istream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_ostream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5210: Native linking failed, undefined symbol: _pb_read. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'System.Net.Security' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'dl' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o)
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o)
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o)
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error : ] in GoogleAppMeasurement(APMMeasurement_87bdad44f2b9aa68c2d607a36be1b8c5.o)
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(884,3): error : linker command failed with exit code 1 (use -v to see invocation)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
This is the image of errors:
Background:
On a Windows 10 PC, I have a c++ codebase. Using CMAKE I generate an Mingw-w64 project (using Eclipse IDE) and a Visual Studio 2017 project. I like compiling my projects with different build systems as each gives different warnings and errors.
As part of the Mingw build, I can enable clang-tidy checks using CMAKE's CXX_CLANG_TIDY. This works well, producing a co-compile showing many interesting warnings from clang-tidy.
When I installed mingw-w64, llvm and VS I was careful not to allow these to populate the PATH environment variable, so a regular command prompt won't run gcc, clang, or CL or any associated tools. The environment is set up by a batch file before launching Eclipse or Visual Studio.
This has worked well for years (I'm still using clang 7.0.1). Both IDE's compile the same code base just fine...
Until I upgrade to Visual Studio 2019, including it's own copy of clang 10.0.0.
Now, my original clang 7.0.1 has stopped working! As I only use clang-tidy it took a while to narrow this down, but the original clang is looking for the system headers in the new clang's include location. The headers it finds are too new and the build fails.
I have found many things to try on SO and elsewhere (although any pointers are welcome) like supplying a --sysroot switch, so this question is more specific:
Question:
When there are no apparent environment variables to point to a specific clang location, where does clang find it's default target triple and therefore it's -internal-isystem paths? Why does my previously-working clang installation now look for it's system headers in a more recently installed clang location?
With a Windows command prompt:
cd C:\Program Files\LLVM\bin (my original clang location)
C:\Program Files\LLVM\bin>clang test.cpp -v
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
"C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-msvc19.26.28806 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\7.0.1" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\7.0.1\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -fdeprecated-macro -fdebug-compilation-dir "C:\\Program Files\\LLVM\\bin" -ferror-limit 19 -fmessage-length 120 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.26.28806 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\Foo\\AppData\\Local\\Temp\\test-c0aac1.o" -x c++ test.cpp
clang -cc1 version 7.0.1 based upon LLVM 7.0.1 default target x86_64-pc-win32
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files\LLVM\lib\clang\7.0.1\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
In file included from test.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\string:9:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\yvals_core.h:462:2: error:
STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer.
#error STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer.
Where C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include is the installed-only-today clang 10.0.0 location, so clearly not compiled into clang.exe.
Where does clang get it's defaults from?
The only "ground truth" is the code of clang itself.
With multiple versions of MSVC installed, clang will use different tricks to setup environment when initializing MSVC toolchain driver (see MSVCToolChain::MSVCToolChain() at the link above)
To solve a similar case I used VCToolsInstallDir environment variable to direct clang to old MSVC include paths.
I followed this tutorial (here) to get Clang working on windows. I choose the path to install clang in combination with msys2.
After following all instructions I wrote the simple programme:
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello, World!\n";
return 0;
}
After compiling with:
clang++ Helloworld.cpp -o Helloworld.exe -std=c++14
I get the error:
*Helloworld.cpp:2:10: fatal error: 'iostream' file not found,
1 error generated.*
Adding -v in the command line I get:
Errors
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\msys64\mingw64\bin
"C:\\msys64\\mingw64\\bin\\clang++.exe" -cc1 -triple x86_64-w64-windows-gnu -emit-obj -mrelax-all -disable-free -disable- llvm-verifier -discard-value-names -main-file-name Helloworld.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "C:\\msys64\\mingw64\\bin\\..\\lib\\clang\\3.9.1" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\backward" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\\\backward" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\\\backward" -internal-isystem "include\\c++" -internal-isystem "include\\c++\\x86_64-w64-mingw32" -internal-isystem "include\\c++\\backward" -internal-isystem "C:\\msys64\\mingw64\\bin\\..\\lib\\clang\\3.9.1\\include" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include" -internal-isystem "C:\\msys64\\mingw64\\include" -std=c++14 -fdeprecated-macro -fdebug-compilation-dir "C:\\msys64\\programming" -ferror-limit 19 -fmessage-length 0 -femulated-tls -fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o "C:\\msys64\\tmp\\Helloworld-2393e7.o" -x c++ Helloworld.cpp
clang -cc1 version 3.9.1 based upon LLVM 3.9.1 default target x86_64-w64-windows-gnu
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\x86_64-w64-mingw32"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\backward"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\\x86_64-w64-mingw32"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\\backward"
ignoring nonexistent directory "C:\msys64\mingw64\include\c++\"
ignoring nonexistent directory "C:\msys64\mingw64\include\c++\\x86_64-w64-mingw32"
ignoring nonexistent directory "C:\msys64\mingw64\include\c++\\backward"
ignoring nonexistent directory "include\c++"
ignoring nonexistent directory "include\c++\x86_64-w64-mingw32"
ignoring nonexistent directory "include\c++\backward"
ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include"
#include "..." search starts here:
#include <...> search starts here:
C:\msys64\mingw64\bin\..\lib\clang\3.9.1\include
C:\msys64\mingw64\include
End of search list.
Helloworld.cpp:2:10: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
How do I get the system to find iostream? I read something about,that you have to point to the mingw headers in clang/lib/Frontend/InitHeaderSearch.cpp. I couldn't find the file InitHeaderSearch.cpp on my computer.
Thank you for your help.
Windows 8
Clang 3.9.1
Due to mistake in the build script some dependencies are missing.
Installing gcc package (mingw-w64-i686-gcc for 32 bit and mingw-w64-x86_64-gcc for 64 bit) will pull them.