Error "expected type `T`, found `T`" with types imported from C headers

To add a little bit of explanation to this:
If you still use @cImport make sure that you only use it in one place, there you can declare it as a public declaration, then from the other place where you need it you can import and use that public declaration.

And if you change towards the new way then the addTranslateC gives you a *TranslateC which you can call add-/createModule module on, the resulting module can be imported at multiple places just like regular modules.

One of the benefits of the new way is that this mistake is less likely to happen (unless you manually create multiple separate translate-c modules).

1 Like