Closed Ontokrat closed 2 years ago
@Ontokrat Thanks for opening this issue.
Import the library.a file in XCode (TARGETS > MacOS > General > Frameworks, Libraries, and Embedded Content)
I don't see this menu option in XCode (I'm running the same version as you), nor does cargo build --lib --release --all-targets
produce any .a files, so I wasn't able to reproduce the issue.
Make sure that you have given your XCode app access to the following frameworks required by whoami:
SystemConfiguration
CoreFoundation
@AldaronLau Thanks for having a look.
You're right, just importing those 2 frameworks in the swift
file calling the C
function did the trick. Kudos.
import CoreFoundation
import SystemConfiguration
I didn't see it in the doc, my bad.
Nevertheless, if you're interested by more on the rust library within Xcode:
.a
file is generated in your_rust_folder > target > release
cargo-lipo
to generate the library for iOS, but the idea is the same)
Hello, I found a bug at the import in Xcode. Any idea?
Describe the bug Fail to import the lib in
Xcode 13.2.1
, as part of a backend Rust library used by aMacOS
app.whoami::devicename()
throws:To Reproduce Steps to reproduce the behavior:
cargo build --lib --release --all-targets
library.a
file inXCode
(TARGETS
>MacOS
>General
>Frameworks, Libraries, and Embedded Content
)Expected behavior No build failure
Versions
Other template sections not relevant