#How to pass data b/w 2 modules that each need to include the linked library?

1 messages · Page 1 of 1 (latest)

wooden ember
#

Linked library contains the functions + extern structs.
Module 1 imports linked library for its wrapper functions.
Module 2 uses linked library and module 1. When I pass linked library to module 1 from module 2, I get errors along the line of linked_library_struct_1239 does not match linked_library_struct_1549 - basically the names match but the hashes at the end don't.

I believe this error is caused by the fact that @include the linked library 2x, once in the first module, and again in the second module, and it treats both includes as distinct. How do I solve this issue? I need the linked library for both modules to pass data between each other.

night island
#

yes youre correct. each @cImport creates its own type and they're not compatible. one solution would be to create a module with the @cImport and provide it to both modules.