Skip to content
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

XCode Undefined symbols for architecture arm64 "_OrtGetApiBase" #328

Closed
jbrummack opened this issue Nov 30, 2024 · 2 comments
Closed

XCode Undefined symbols for architecture arm64 "_OrtGetApiBase" #328

jbrummack opened this issue Nov 30, 2024 · 2 comments

Comments

@jbrummack
Copy link

Im using ORT2.0.0-rc.9 in a library i try to use from Swift, but it doesnt find this Symbol.
The "you may have to compile ONNX Runtime from source" error went away after statically linking the compiled onnxruntime (v1.20), but im not sure if i compiled the runtime right because there is no libonnxruntime.a only a .dylib.
./build.sh --config Release --parallel --use_xcode --ios --use_coreml --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 16

Undefined symbols for architecture arm64:
  "_OrtGetApiBase", referenced from:
      std::sync::once::Once::call_once_force::_$u7b$$u7b$closure$u7d$$u7d$::h47f52d7832dce82e (.llvm.14180137373844910416) in libimage_bridge-ios.a[247](ort-46c9f4dffbc173d0.ort.3dae33b5982acf3c-cgu.10.rcgu.o)
      core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h3fd7027c9915fc5e (.llvm.14180137373844910416) in libimage_bridge-ios.a[247](ort-46c9f4dffbc173d0.ort.3dae33b5982acf3c-cgu.10.rcgu.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thank you!

@decahedron1
Copy link
Member

By "using [...] in a library i try to use from Swift," do you mean you are compiling a Rust crate as a staticlib, and then trying to link to that from a Swift package?

@jbrummack
Copy link
Author

Im compiling my library into an XCFramework which is a dependency for a SPM Package. I fixed it by adding onnxruntime-swift-package-manager as a dependency in XCode, resolving the linking error. Which means I most likely made a mistake when compiling the onnxruntime library for iOS.

@decahedron1 decahedron1 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants