New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol not found error integrating BASS audio library with ffigen #220
Comments
I have a setup locally with xcframeworks
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
"OTHER_LDFLAGS[sdk=iphoneos*]" => "-force_load $(PODS_TARGET_SRCROOT)/Frameworks/mylib_staticlib.xcframework/ios-arm64_armv7/libmylib_staticlib.a",
"OTHER_LDFLAGS[sdk=iphonesimulator*]" => "-force_load $(PODS_TARGET_SRCROOT)/Frameworks/mylib_staticlib.xcframework/ios-arm64_x86_64-simulator/libmylib_staticlib.a",
}
s.vendored_frameworks = 'Frameworks/mylib_staticlib.xcframework'
s.swift_version = '5.0'
// A dummy file so that the mylib_staticlib.framework is created.
s.pod_target_xcconfig = {
--
| 'DEFINES_MODULE' => 'YES',
| 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64',
| "OTHER_LDFLAGS" => "-force_load $(PODS_TARGET_SRCROOT)/Frameworks/libmylib_staticlib.a"
| }
| s.vendored_libraries = 'Frameworks/libmylib_staticlib.a' Other things to double check:
P.S. This is not an ffigen issue, the bindings are not wrong. |
Thanks for that hint! I'm trying to use a static library, so I tried adding these two lines to my podspec file:
but I get a file not found error:
But the .a file is at that location:
Apologies for what feels like a newbie question now... Thanks! |
Found that the ( ) around $SRCROOT in the -force_load were causing the problem. |
I'm trying to integrate the BASS audio dynamic library for iOS from un4seen Developments with Flutter. I've started a Flutter FFI plugin that can be found here. It uses ffigen to convert the bass.h file to generated_bindings.dart.
Here is a snippet from generated_bindings.dart:
It builds (Flutter 3.3, XCode 14, ffigen 6.1.2) but throws a run-time error when I try to call the BASS_init function: Failed to lookup symbol '_BASS_Init': dlsym(0x100f61e18, _BASS_Init): symbol not found
I can see the symbol in the libbass.a file using nm -gU libbass.a
I added the following frameworks to the Xcode build: AVFoundation, AudioToolbox, SystemConfiguration, CFNetwork, Accelerate In Xcode by going to Build Phase-->Link Binary with Libraries-->Add This did not make any difference i.e. still getting symbol error
I checked that “Enable bitcode” is set to “No” in Xcode under Build Settings-->Build Options.
Any comments/suggestions greatly appreciated!
The text was updated successfully, but these errors were encountered: