Post not yet marked as solved
I'm getting what seems to be a dynamic linker error, but can't seem to resolve it.
dyld[541]: Library not loaded: @rpath/TCore.framework/TCore
Referenced from: /private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/FaceSDK
Reason: tried: '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/System/Library/Frameworks/TCore.framework/TCore' (no such file)
Library not loaded: @rpath/TCore.framework/TCore
Referenced from: /private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/FaceSDK
Reason: tried: '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/Navigatio
So far I've tried embedding it and linking it in both "General" and "Build Phase" of the Settings. I've tried setting Dynamic Library Install Name Base to @rpath as well as setting Always Embed Swift Standard Libraries to YES, but none seem to work.
Post not yet marked as solved
We have an app that has a deployment target of iOS 13.0 and was built using Xcode 13.2.1.
An embedded custom framework implements an iOS 14 widget, has a deployment target of iOS 14, and weak links against WidgetKit and SwiftUI.
When running on iOS 13.0-13.3.x we are getting a crash on launch:
Symbol not found: _swift_getTypeByMangledNameInContextInMetadataState\n Referenced from: /private/var/containers/Bundle/Application/AA26538A-91B0-4B27-BA5D-0C0CEA30CEED/X.app/Frameworks/WidgetUI.framework/WidgetUI (which was built for iOS 14.0)\n Expected in: /usr/lib/swift/libswiftCore.dylib\n
(BTW it took some work to get this message. dyld's ImageLoaderMachO::throwSymbolNotFound results in a failed_throw which terminates the app without any messages. So I had to create a symbolic breakpoint for ImageLoaderMachO::throwSymbolNotFound and step thru the assembly in lldb as the exception string was getting built)
On iOS 13.4.x-13.7, we don't see a crash which appears to be because swift_getTypeByMangledNameInContextInMetadataState got introduced in iOS 13.4.
Looking at nm -a on the iOS 14.0 framework it appears that linking against SwiftUI is what's causing the framework to reference _swift_getTypeByMangledNameInContextInMetadataState
The custom framework is not marked as optional in our production code, but changing it to optional doesn't fix the crash.
Anything else we could try to avoid this crash?
side note: When I run otool -L on the framework all the swift libraries have a prefix of /usr/lib/swift. For example /usr/lib/swift/libswiftCore.dylib Is this correct?
Post not yet marked as solved
Hello to everyone.
I am not big specialist in Xcode. I have built my unity game for IOS. This game contains Firebase and Appodeal plugins. I don't know what should I do because I have added firebase sdk from GitHub but Xcode sends me an error. I have tried to install all firebase SDK but it does not help. What should I do to resolve this problem.
Errors:
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/venya/Desktop/GB_apple/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FIRApp", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIRTransactionResult", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"OBJC_CLASS$_FIRDatabase", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_ios.mm.o)
"OBJC_CLASS$_FIRGameCenterAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRGoogleAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRPhoneAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRPhoneAuthCredential", referenced from:
objc-class-ref in libFirebaseCppAuth.a(user_ios.mm.o)
"OBJC_CLASS$_FIROptions", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIROAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRConfiguration", referenced from:
objc-class-ref in libFirebaseCppApp.a(app_ios.mm.o)
"OBJC_CLASS$_FIRFacebookAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRDatabaseReference", referenced from:
objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios.mm.o)
"OBJC_CLASS$_FIREmailAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRGitHubAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRTwitterAuthProvider", referenced from:
objc-class-ref in libFirebaseCppAuth.a(credential_ios.mm.o)
"OBJC_CLASS$_FIRAuth", referenced from:
objc-class-ref in libFirebaseCppAuth.a(auth_ios.mm.o)
"_FIRAuthErrorUserInfoUpdatedCredentialKey", referenced from:
firebase::auth::SignInResultCallback(FIRAuthDataResult*, NSError*, firebase::SafeFutureHandlefirebase::auth::SignInResult, firebase::auth::AuthData*) in libFirebaseCppAuth.a(auth_ios.mm.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Post not yet marked as solved
We are seeing a crash on launch on Xcode 13.3 which did not happen on 13.2.x.
dyld[80074]: Symbol not found: _$s10Foundation10URLRequestV10httpMethodSSSgvs
Has anyone see this kind of dynamic linking error before?
Post not yet marked as solved
Hello.
We are facing an issue with Xcode 13.3.1.
We have an application with a "large" number of integrated frameworks. We use those frameworks to modularize smalls parts of our app. Currently we have more than 200 modules.
With Xcode 13.2.1 we have no problem with this number of frameworks. But with Xcode 13.3.1 out app crashes when launching on a device but on simulators it works just fine.
The error that we get is:
dyld[458]:
unknown library ordinal -15 in /private/var/containers/Bundle/Application/B1B4B241-A959-4BAB-91F0-57D3A786EC84/AppName.app/AppName when binding '_$s2os0A4_log_3dso0B04type_ys12StaticStringV_SVSgSo03OS_a1_B0CSo0a1_b1_D2_tas7CVarArg_pdtF'
After different attempts out we found that this issue was related to the amount of frameworks embebed in our app.
We use Cocoapods to integrate our modules but this issue happens even if the frameworks are integrated directly on Xcode, without Cocoapods. We checked this by creating a sample project. Unfortunately the forum won't allow me to attach the project here.
This is what I mean with "integrate the frameworks directly on Xcode":
It crashes with Xcode 13.3.1 and 224 frameworks.
This is an image of the crash:
If you remove just one framework, the app starts correctly.
And if you run the project with Xcode 13.2.1 and 224 frameworks, the app starts just fine.
I think this issue may be related with this other question on the forum
Post not yet marked as solved
My app uses a 3rd party framework built for iOS 13.1 for some functionality that will only be available to users with A12 or newer chipsets. We planned to disable access to that functionality on older devices at runtime and do not need to load/call any functions in the related framework.
The issue is that including the framework in the app causing crashes on iOS 12.5 and earlier with
dyld: Symbol not found: ___chkstk_darwin
Referenced from: /private/var/containers/Bundle/Application/.../<framework> (which was built for iOS 13.1)
Expected in: /usr/lib/libSystem.B.dylib
which makes sense to me but I'm hoping to work around it :)
I have reached out to the framework developers to look at building for a lower minimum OS version but they rely on features that came in with iOS 13 so are not sure if it can be done, how long it might take, or when they could look at it..
Since the framework is not needed on iOS 12.5 or earlier, looked into weak linking against it. This works about halfway. If I weak link the framework and don't embed it in the app, things work as I need. If I include it, I get the same crash as above.
Hoping for info/help with the following possibilities (if possible):
Is there a way to ignore specific undefined symbols without modifying the framework?
Is there a way to weak link that covers this case but I was doing it wrong?
Is there a way to ship the impacted framework only on iOS 13 and above, but from the same listing in the app store?
Any other options I'm not aware of ?
Post not yet marked as solved
Hello
First at all a need to say that I'm new using macOs and Xcode. My problem is this.
I'm trying to create a Core Audio driver, I'm using the sample code for creating an Audio Server Driver Plug-in for building a virtual audio device and everything is fine with this example, but when I adding portaudio c++ library and copy the .driver to /Library/Audio/Plug-Ins/HAL and after reboot my Mac the driver disappear from the Audio MIDI Setup.
I had triad to add NDI library to but I got the same problem.
My question if that
Is it possible to add a c++ library to the core audio driver example ? and what is the proper way to do that?
Thanks you
Alvaro
Post not yet marked as solved
Why Mac, Why again?
Command Line Tools is such a nightmare. I am using a macOS Monterey v 12.0.1
I am trying to install a PERL package by:
cpanm DBI
The output is:
clang-10: warning: argument unused during compilation: '--sysroot /opt/MacOSX10.9.sdk' [-Wunused-command-line-argument]
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [blib/arch/auto/DBI/DBI.bundle] Error 1
-> FAIL Installing DBI failed. See /Users/tito_miniconda/.cpanm/work/1643647544.76158/build.log for details. Retry with --force to force install it.
I am running out of ideas on how to handle this. Please any help is greatly appreciated.
Post not yet marked as solved
Running on the simulator & real machine will not crash, uploading Testflight installation will not crash, only Ad-hoc crash
CrashReporter Key: 853c4fc40b6de72d451a39a413a14107a39a33d8
Hardware Model: iPhone13,4
Process: Kasta [11064]
Path: /private/var/containers/Bundle/Application/488D3FA6-DAB2-47BD-9C76-F41FC9A2894C/Kasta.app/Kasta
Identifier: Kasta.xxxxxx.xxxxxx
Version: 2.6.059 (1311)
AppStoreTools: 13E113
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: Kasta.xxxxxx.xxxxxx [1653]
Date/Time: 2022-04-02 14:20:34.5538 +0800
Launch Time: 2022-04-02 14:20:34.5177 +0800
OS Version: iPhone OS 15.3.1 (19D52)
Release Type: User
Baseband Version: 2.23.02
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x1b853f964 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1f21fd378 pthread_kill + 268
2 libsystem_c.dylib 0x18bd48f50 abort + 164
3 libswiftCore.dylib 0x1086f4028 swift::fatalError(unsigned int, char const*, ...) + 56
4 libswiftCore.dylib 0x1086ec1c8 checkVersion() + 60
5 dyld 0x1079f4794 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 164
6 dyld 0x107a28510 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 168
7 dyld 0x1079f2428 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 532
8 dyld 0x1079f1678 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
9 dyld 0x1079f09d0 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
10 dyld 0x107a28098 dyld3::MachOAnalyzer::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, unsigned char const*, bool&) block_pointer) const + 148
11 dyld 0x1079fddc0 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 432
12 dyld 0x1079fa968 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 172
13 dyld 0x1079f2144 dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const + 44
14 dyld 0x1079f6344 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 208
15 dyld 0x1079f6320 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 172
16 dyld 0x1079fc4b0 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 124
17 dyld 0x107a1c124 dyld4::APIs::runAllInitializersForMain() + 320
18 dyld 0x107a07508 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3024
19 dyld 0x107a05a84 start + 488
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x00000000005069d0 x5: 0x0000000000000010 x6: 0x0049000004210143 x7: 0x000000000000003e
x8: 0x6315f34501847698 x9: 0x6315f3440621f318 x10: 0x0000000000000000 x11: 0x0000000000000002
x12: 0x00000000aec51855 x13: 0x000000002ec51800 x14: 0x000000002ec00000 x15: 0x0000000000000007
x16: 0x0000000000000148 x17: 0x0000000107a58580 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000000103 x21: 0x0000000107a58660 x22: 0x00000001087906f0 x23: 0x0000000108470710
x24: 0x0000000108470830 x25: 0x000000016b606210 x26: 0x0000000108470dd0 x27: 0x00000000000013a0
x28: 0x0000000107a986f0 fp: 0x000000016b605f20 lr: 0x00000001f21fd378
sp: 0x000000016b605f00 pc: 0x00000001b853f964 cpsr: 0x40001000
far: 0x00000001d7c71e50 esr: 0x56000080 Address size fault
Binary Images:
0x1b8538000 - 0x1b856bfff libsystem_kernel.dylib arm64e <ff3ee512a0bc3123b983d365a71fb06a> /usr/lib/system/libsystem_kernel.dylib
0x1f21f6000 - 0x1f2201fff libsystem_pthread.dylib arm64e <a17d07cfe86a392387c4921045898a8a> /usr/lib/system/libsystem_pthread.dylib
0x18bd29000 - 0x18bda7fff libsystem_c.dylib arm64e <9b299ee5b3793856848b524d82640dbc> /usr/lib/system/libsystem_c.dylib
0x108470000 - 0x10878ffff libswiftCore.dylib arm64 <ad0cad3b1b51332786448be1ff1f0ae9> /private/var/containers/Bundle/Application/488D3FA6-DAB2-47BD-9C76-F41FC9A2894C/Kasta.app/Frameworks/libswiftCore.dylib
0x1079ec000 - 0x107a43fff dyld arm64e <780553c7d39f322a8cb9f4f6de52610d> /usr/lib/dyld
EOF
Post not yet marked as solved
Hi,
I understand that all objects and static libraries linked into one executable need to be compiled with the same deployment target. Is it OK to static link objects that were compiled with the same deployment target but different SDK versions?
Post not yet marked as solved
Hi,
'dlopen' ignores the search path that is defined for LD_LIBRARY_PATH on macOS 12.2 and 12.3, even-though the path doesn't contain slash.
LD_LIBRARY_PATH is set as follows (before the call):
export LD_LIBRARY_PATH="/Users/administrator/Desktop/Test/"
'test_library.dylib' is located under '/Users/administrator/Desktop/Test/'
The c call at the application looks as follows (The application is built by Xcode 13):
handle = dlopen("test_library.dylib", RTLD_LAZY);
I see that the error i get, when calling to dlopen, is that test_library.dylib isn't found. From the error it looks that
library loader doesn't search the library at the search path that is defined for LD_LIBRARY_PATH. During the call, the LD_LIBRARY_PATH contains the path.
If i set this path to DYLD_LIBRARY_PATH, dlopen finds 'test_library.dylib' and everything works as expected.
I didn't find any documentation for this issue, therefore, is it a known limitation? Is there a workaround?
Thx,
Moshe.
Post not yet marked as solved
Hi there.
I'm trying to run objc app with Iobfs4proxy framework.
I got such error.
ld: warning: directory not found for option '-F/Users/ivan/Projects/buddy-onion/Tob/../Carthage/Build/iOS'
ld: in /Users/ivan/Projects/buddy-onion/Tob/Iobfs4proxy.framework/Iobfs4proxy(go.o), section __TEXT/__text address out of range file '/Users/ivan/Projects/buddy-onion/Tob/Iobfs4proxy.framework/Iobfs4proxy' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Device: Air m1(2020)
OS: Monterey 12.2.1
XCode: 13.3
iOS: 15.3.1 (real device)
Post not yet marked as solved
Hello,
I faced a weird problem with my framework imported into my app. MyFramework uses some other frameworks like OpenSSL etc. I build MyFramework with the script:
FrameworkName="MyFramework"
rm -rf build/
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS' \
-archivePath "./build/$FrameworkName.framework-iphoneos.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS Simulator' \
-archivePath "./build/$FrameworkName.framework-iphonesimulator.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=macOS' \
-archivePath "./build/$FrameworkName.framework-macos.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
# Fix https://bugs.swift.org/browse/SR-14195 (caused by https://bugs.swift.org/browse/SR-898)
pattern="./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework/Modules/$FrameworkName.swiftmodule/*.swiftinterface"
grep -rli "$FrameworkName.$FrameworkName" $pattern \
| xargs sed -i '' "s,$FrameworkName.$FrameworkName,$FrameworkName,g"
# end fix
xcodebuild -create-xcframework \
-framework "./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-macos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-output "./build/$FrameworkName.xcframework"
# Wait for process completion and verify result
pid=$!
wait $pid
echo "Process with PID $pid has finished with Exit status: $?"
[[ ! -d "./build/$FrameworkName.xcframework/" ]] && {
msg="[ERROR] expected ./build/$FrameworkName.xcframework/ to exist"; echo -e $msg
exit 1
}
As you can see, it is also built framework for the macOS platform.
A little digression: I prefer using Carthage to build xcframeworks, but here it doesn't work, I don't the reason.
The aforementioned build solution works great, all frameworks included in MyFramework don't have any issues when I use MyFramework in my iOS App. The problem starts with using MyFramework in macOS target App. It shows two related errors, I tried some solutions but didn't find a proper way... Errors:
blablabla/DerivedData/MyApp-hdzvzxtsnsdivzcialzikxjdwidw/Build/Products/Debug/MyFramework.framework/Modules/MyFramework.swiftmodule/arm64-apple-macos.swiftinterface:9:8: error: no such module 'OpenSSL'
import OpenSSL
And the second one:
blablabla/Helpers/Injected/Services.swift:10:8: error: failed to build module 'MyFramework' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
import MyFramework
I can import the OpenSSL framework to the macOS app and then I faced the same problem with the next framework from MyFramework's importing list - it isn't a solution...
What causes that problem?
Thanks in advance for any help... 🥺
Post not yet marked as solved
Hello folks, I am new to MacOS/iOS and ran into the following problem (IDE is Xcode13): I have made a small c++ audio library with the Juce framework that I want to integrate into an existing application running on MacOS and iOS.
So far so good, I added the Projucer library project as a subproject to my workspace, added the correct header paths, added the subproject as a dependency and linked the library in the build settings of the target, so I can directly test changes I make to the library in the app (for now it is only a small c++ console app for testing since I wanted to find out how to correctly import the library before writing the bridge, as described here: https://github.com/adamski/audioengine-demo).
The problem I am currently running into is the following linker error I cant resolve:
Undefined symbols for architecture arm64:
ld: symbol(s) not found for architecture arm64
This error occurs 101 times, for every juce function that is beeing used. I checked the target architecture settings in both the library and the console app, they are the same. If I change the build active architecture only setting to No, the error changes to
ld: symbol(s) not found for architecture x86_64
I analysed the library binary with the file command in the console, which led to following output:
mylib.a : Mach-O universal binary with 2 architectures: [arm64:current ar archivecurrent ar archive] [x86_64]
mylib.a (for architecture arm64): current ar archive
mylib.a (for architecture x86_64): current ar archive
In my understanding, the binary should support my architecture (arm64), so why cant the linker find the symbols?
Thanks for your help!
Attempting to compile dieharder from source on an M1 Max MacBookPro18,2 (macOS 12 + Xcode 13.3.1 + command line tools) and running into an error:
...
/bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -L/opt/local/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas
libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/local/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas
Undefined symbols for architecture arm64:
"_insert", referenced from:
_dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o)
_main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o)
"_insertBit", referenced from:
_dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
I got to this failure with a MacPorts installed gsl and by executing the following:
$ mkdir dieharder; cd dieharder
$ wget --no-check-certificate https://webhome.phy.duke.edu/~rgb/General/dieharder/dieharder-3.31.1.tgz
$ tar xf dieharder-3.31.1.tgz
$ cd dieharder-3.31.1
$ sudo port install gsl
$ ./configure LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include --disable-shared
...
$ make
...
I reproduced the failure with Homebrew:
$ brew install gsl
$ make distclean
$ ./configure LDFLAGS=-L/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include CFLAGS=-I/opt/homebrew/include --disable-shared
...
$ make
...
/bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -L/opt/homebrew/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas
libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/homebrew/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas
Undefined symbols for architecture arm64:
"_insert", referenced from:
_dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o)
_main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o)
"_insertBit", referenced from:
_dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [dieharder] Error 1
make: *** [dieharder.time] Error 2
Anyone know what might be going on here and how to properly configure this to complete compilation on and for Apple Silicon systems?
Post not yet marked as solved
This might seem flippant, but it's very serious. My use case, this is literally torturing me to death:
We have a language (Allegro Common Lisp) which has a module for making SSL connections. This module is requires OpenSSL. We don't want to supply OpenSSL with our product for obvious reasons--I'm not going to go into that here.
So, what's the problem? Well, first, the problem is that Apple decided long ago to not allow developers to build against their version of SSL (which is based on LibreSSL). So, we must depend on Macports or Homebrew for the installation of OpenSSL. Those libraries are in non-standard places and require DYLD_LIBRARY_PATH to be set so that the libraries can be dynamically loaded.
The problem is, with SIP, any environment variables that start with DYLD_ or LD_ are stripped from the environment passed to programs. That is, if I set DYLD_LIBRARY_PATH in BASH and start my product, I can't load a signed .dylib that depends on some version of the OpenSSL libraries.
To make matters worse, this works on macOS 11.6.5 (20G527) x86_64:
DYLD_LIBRARY_PATH=... ./mlisp
(sys:getenv "DYLD_LIBRARY_PATH")`
That is, it returns the value ... set on the command line.
It does not work on macOS 11.6.5 (20G527) arm64.
To dynamically load the OpenSSL libraries, we have a glue library (that adds functionality) called acliss11.dylib which depends on @rpath/libssl.1.1.dylib and @rpath/libcrypto.1.1.dylib.
For x86_64 we have a solution, but the same solution does NOT work for arm64.
How are we supposed to do this?
When I archive my iOS app with Xcode 13.3 RC and run it on macOS Big Sur, the app crashes on launch with a DYDL error:
Termination Reason: DYLD, [0x1] Library missing
Dyld Error Message:
dyld: Using shared cache: 331F452F-2BAE-3A64-AD52-0029F44B1379
dependent dylib '@rpath/SomeFramework.framework/SomeFramework' not found for '/private/var/folders/*/SomeApp.app/SomeApp'. chained fixups, seg_count exceeds number of segments
The app runs fine on macOS Monterey and on iOS 13, 14, 15. The LD_RUNPATH_SEARCH_PATH in the build settings is correct and when inspecting the binary with otool -l the LC_RPATH entries are also correct.
When archiving the app with Xcode 13.2.1, it runs fine on macOS Big Sur.
Has anybody experienced the same and knows a workaround?
I've filed a feedback: FB9951126
Post not yet marked as solved
I have a MacOS app with a Framework (FrameA) inside. In this FrameA there is a compiled Framework (FrameB).
The error is:
Library not loaded: @loader_path/../Frameworks/FrameB.framework/Versions/A/FrameB
Referenced from: /Users/myUsername/Desktop/AppName.app/Contents/Frameworks/FrameA.framework/Versions/A/FrameA
Reason: tried: '/Users/myUsername/Desktop/AppName.app/Contents/Frameworks/FrameA.framework/Versions/A/../Frameworks/FrameB.framework/Versions/A/FrameB' (no such file), '/Library/Frameworks/FrameB.framework/Versions/A/FrameB' (no such file), '/System/Library/Frameworks/FrameB.framework/Versions/A/FrameB' (no such file)
I have try in the FrameA to embed FrameB but it can't find it because of the path. There is always a /../ and this is the problem because it go one folder back. It should not.
You can see the problem in this part of the error:
FrameA.framework/Versions/A/../Frameworks
When i try to edit the runpath on FrameB, the app still seach on the same place. It has not effect whatever i change there.
If i change the runpath of the app to
@executable_path/Frameworks then it can't find FrameA.
This is expected but i don't understand why it ignore what i write in the runtime of FrameA.
Another try was to not embed FrameB into FrameA but directly into the App. The App (exported) still complain and want to seach FrameB after the path of FrameA. But in this test FrameB was no more embed into FrameA.
In my App runpath i have:
$(inherited)
@executable_path/../Frameworks
@loader_path/Frameworks
In the FrameA runpath i have (its completly ignored in any case):
$(inherited)
@executable_path/Frameworks
@loader_path/Frameworks
When i look into the exported app, the FrameB is on the place wanted for both try. Only the path to search it is wrong with this /../ in the middle of the path.
How can i fix this ?
Post not yet marked as solved
0
In my web projet I'm implementing link with popup with Apple as a provider.
I'm allways getting the following error:
code: "auth/invalid-credential"
message: "Error getting access token from https:/appleid.apple.com,	OAuth2 redirect uri is: https:/myproject.firebaseapp.com/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, headers=HTTP/1.1 200 OK
Here is my code:
	AppleLink = function () {
		let provider = new firebase.auth.OAuthProvider('apple.com');
		provider.addScope('email');
		provider.addScope('name');
		firebase.auth().languageCode = 'pt';
		linkWithProvider(provider);
};
linkWithProvider = function (provider) {
		let email = 'some@email.com';
		let pass = 'somepassword';
		firebase.auth().signInWithEmailAndPassword(email, pass).then(function (result) {
				var user = result.user;
				if (user) {
						user.linkWithPopup(provider).then(function (result) {
								providerinput = true;
						});
				}
		}).catch(function (error) {
				let errorCode = error.code;
		});
};
How do I get pass that error?
Post not yet marked as solved
When compiling qt6webengine in debug, I am getting this link errors.
I am using macOS Monterey 12.2
Apple M1 Pro with
16G RAM
Assertion failed: (target.atom != NULL), function findTargetFromAddressAndSectionNum, file macho_relocatable_file.cpp, line 3131.
0 0x100b13bb4 __assert_rtn + 128
1 0x100b14378 mach_o::relocatable::Parser<x86_64>::addFixups(mach_o::relocatable::Parser<x86_64>::SourceLocation const&, ld::Fixup::Kind, mach_o::relocatable::Parser<x86_64>::TargetDesc const&) (.cold.1) + 0
2 0x1009db098 mach_o::relocatable::Parser<x86_64>::addFixups(mach_o::relocatable::Parser<x86_64>::SourceLocation const&, ld::Fixup::Kind, mach_o::relocatable::Parser<x86_64>::TargetDesc const&) + 0
3 0x1009da774 mach_o::relocatable::Section<x86_64>::addRelocFixup(mach_o::relocatable::Parser<x86_64>&, macho_relocation_info<Pointer64<LittleEndian> > const*) + 380
4 0x1009eca5c mach_o::relocatable::Section<x86_64>::makeFixups(mach_o::relocatable::Parser<x86_64>&, mach_o::relocatable::Parser<x86_64>::CFI_CU_InfoArrays const&) + 128
5 0x1009e8ed0 mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 2152
6 0x1009e0a50 mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 144
7 0x100a140ec archive::File<x86_64>::makeObjectFileForMember(archive::File<x86_64>::Entry const*) const + 724
8 0x100a139cc archive::File<x86_64>::justInTimeforEachAtom(char const*, ld::File::AtomHandler&) const + 108
9 0x100a32268 ld::tool::InputFiles::searchLibraries(char const*, bool, bool, bool, ld::File::AtomHandler&) const + 216
10 0x100a3e24c ld::tool::Resolver::resolveUndefines() + 172
11 0x100a4157c ld::tool::Resolver::resolve() + 76
12 0x1009d28a8 main + 288