BUG: Mixing shared and static libs on MacOS causes errors