I'm still very new to Swift, so if someone wouldn't mind providing some help, I'd really appreciate it. I'm trying out making a Swift CLI program, and I'd like to incorporate OpenCV (a C library for image processing). I found this package, which indicates that it provides a wrapper around the C library in the form of a binary: GitHub - r0ml/OpenCV: Swift Package for OpenCV
It doesn't provide any coding examples, nor can I find any, which leaves me a bit concerned (maybe I'm misunderstanding and I have to build the wrapper myself?). Anyway, I've modified my package file as appropriate, I believe (see below). When I build my program, I can see that it has downloaded the OpenCV package. It gives me no errors with including "OpenCV" as a dependency of my executable in the package file, suggesting everything is good there.
However, I cannot figure out how to interact with the code in my main.swift. "import OpenCV" gives me a "No such module" error, as does any other capitalization of "opencv." I just can't figure out whether I'm importing the package wrong or misunderstanding what the package actually provides. And advice would be greatly appreciated. Thank you!
let package = Package(
name: "MyPackage",
platforms: [.iOS(.v17), .macOS(.v13)],
dependencies: [
.package(url: "https://github.com/r0ml/OpenCV", from: "4.9.0")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: "Swarcadia", dependencies: ["OpenCV"])
]
)```