Make sure your building toolchain meets minimal requirements:
https://dev.opencascade.org/doc/overview/html/index.html#OCCT_OVW_SECTION_5
Note that MinGW-w64 is required for building OCCT (obsolete MinGW is not supported).
Please also provide details (versions) of used building toolchain, if it looks up-to-date.