I got this error once after using VS2022 instead of my usual VS 2017. The solution for me was to do the following:
This error also come when Window SDK Version is higher then 10.0.17763.0.
Project Settings > C/C++ > Code Generation > Struct Member Alignment (change to Default)