Here’s my setup:
Stat
.Stat
in its own classes (this framework is called Dyn
). The static library and this framework are in the same Xcode project.Dyn
.In my app I have code like:
import Cocoa import Dyn ... SomeDynClass().doSomething()
However, when I try to compile I get an error when I import Dyn
. The error is
error: missing required module ‘Stat'
It appears my app can find my framework just fine, but it somehow needs to find a module for my static library, too?
Stat
has a module file that’s pretty basic:
module Stat { header "Stat.h" export * }
I think I need to point my Mac app’s framework search paths at Stat
but I don’t know why and I don’t know how. How do I solve this?
Select your Target
, then go into Build Settings
and set the Import Paths
within the Swift Compiler
- Search Paths
section:
${SRCROOT}/Stat
Normally the module would be named the same as the library, however, I'm not sure how you've setup the directory with the module.map
(it could be named Dyn
perhaps, in which case the Import Path would reflect that name.
Build Settings > Swift Compiler > Search Paths:
${SRCROOT}/(directory with module.map) should resolve itself once you press enter or tab..
I got the same error when in my unit tests project which involves SQLite3 package. After I add the package, unit tests always throw out error saying "missing required module SQLiteObjc"
I had it fixed by toggle "Force Package Info Generation" on and off in my Unit Tests Target's build setting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With