Cyrille QUÉMIN
02/28/2019, 11:51 PMld: symbol(s) not found for architecture arm64
this only appears because I added staticLibraries
and a libraryPaths
in my def file since I noticed that the google framework contains
a native library .a
and other frameworks as part of the its internal dependency. I have tried multiple combination of using linkerOpts
with -L
or -F
pointing at the folder where the framework has been imported but nothing works.
I have not been able to find a clear explanation as to how to create correct cinterops with ios framework that contains a static library and multiple indirect dependencies since I suspect that the impossibility
to export this as ios framework is related to my wrong configuration of the cinterops.
Thanks in advance
Def File:
depends = Foundation
language = Objective-C
headers = GNSMessages.h
staticLibraries = NearbyMessages/Libraries/libGNSMessages.a
libraryPaths = /Users/cyrille.quemin/Documents/git/multiplatform-p2p/p2p-common/src/iosMain/dependencies/Pods
Cinterops:
binaries {
framework("p2p_common") {
linkerOpts "-L${podsDir}/NearbyMessages/Libraries"
}
}
compilations.main.cinterops {
NearbyMessage {
defFile "src/iOSMain/c_interop/NearbyMessages.def"
includeDirs "${podsDir}/Headers/Public/NearbyMessages"
linkerOpts "-F${podsDir}/NearbyMessages/Libraries/"
}
}
svyatoslav.scherbina
03/01/2019, 7:46 AMld: symbol(s) not found for architecture arm64Is it possible that you have added only simulator variant of static library?
linkerOpts “-F${podsDir}/NearbyMessages/Libraries/”This line should be moved under
framework {
.Cyrille QUÉMIN
03/01/2019, 8:27 AMpreset.iosX64
, and to move the line under framework
like you suggested, but still get the same error at the linking phase : linkP2p_commonDebugFrameworkIOS
svyatoslav.scherbina
03/01/2019, 8:30 AMCyrille QUÉMIN
03/01/2019, 8:50 AM> Task :p2p-common:linkP2p_commonDebugFrameworkIOS
ld: warning: ignoring file /Users/cyrille.quemin/Documents/git/multiplatform-p2p/p2p-common/src/iOSMain/Libraries/CryptoCocoa.framework/CryptoCocoa, missing required architecture x86_64 in file /Users/cyrille.quemin/Documents/git/multiplatform-p2p/p2p-common/src/iOSMain/Libraries/CryptoCocoa.framework/CryptoCocoa (2 slices)
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
Undefined symbols for architecture x86_64:
"_AVAudioSessionCategoryPlayAndRecord", referenced from:
l069 in libGNSMessages.a(GNSAudioModem.o)
"_AVAudioSessionInterruptionNotification", referenced from:
l018 in libGNSMessages.a(GCPAudioTokenStrategy.o)
l019 in libGNSMessages.a(GCPAudioTokenStrategy.o)
"_AVAudioSessionInterruptionTypeKey", referenced from:
l098 in libGNSMessages.a(GCPAudioTokenStrategy.o)
"_AVAudioSessionRouteChangeNotification", referenced from:
l004 in libGNSMessages.a(GNSAudioPlayer.o)
"_AudioQueueAllocateBuffer", referenced from:
l009 in libGNSMessages.a(GNSAudioPlayer.o)
l038 in libGNSMessages.a(GNSAudioRecorder.o)
"_AudioQueueDispose", referenced from:
l005 in libGNSMessages.a(GNSAudioPlayer.o)
l024 in libGNSMessages.a(GNSAudioRecorder.o)
[...]
l005 in libGNSMessages.a(GNSImage.o)
"_UIGraphicsBeginImageContextWithOptions", referenced from:
l005 in libGNSMessages.a(GNSImage.o)
"_UIGraphicsEndImageContext", referenced from:
l005 in libGNSMessages.a(GNSImage.o)
"_UIGraphicsGetCurrentContext", referenced from:
l005 in libGNSMessages.a(GNSImage.o)
"_UIGraphicsGetImageFromCurrentImageContext", referenced from:
l005 in libGNSMessages.a(GNSImage.o)
"_vDSP_vflt16", referenced from:
l026 in libGNSMessages.a(GNSAudioRecorder.o)
ld: symbol(s) not found for architecture x86_64
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Cyrille QUÉMIN
03/01/2019, 8:50 AMsvyatoslav.scherbina
03/01/2019, 8:58 AMUndefined symbols for architecture x86_64:
"_AVAudioSessionCategoryPlayAndRecord", referenced from:
l069 in libGNSMessages.a(GNSAudioModem.o)
This error means that libGNSMessages.a
depends on AVFoundation, so you should include -framework AVFoundation
to your linker options too.Cyrille QUÉMIN
03/01/2019, 9:10 AMCyrille QUÉMIN
03/01/2019, 9:10 AMsvyatoslav.scherbina
03/01/2019, 9:37 AMCyrille QUÉMIN
03/01/2019, 10:10 AMCyrille QUÉMIN
03/01/2019, 10:33 AM-framework
option? It work fine with Apple framework but I need to add some framework that are not from Apple. I tried relative paths, absolute paths and I keep on having: ld: framework not found GoogleInterchangeUtilities
where this displays the argument I put after -framework
optionCyrille QUÉMIN
03/01/2019, 11:07 AMlinkerOpts = -framework AVFoundation -F path/to/my/framework/folder -framework MyFramework
works