related topic, should help. also a tip: use extern with align for struct fields instead of packed .
extern
align
packed