Hey there.
Had the same problem. Look at your output window for the build. Mine was failing due to multiple definitions of SystemClockUpdate, a result of including STM32F1xx_hal.c (or something like it) twice. I removed the one that STM32CubeMX generated, retaining the version that was included with the HAL package, and my build worked.
Find the function that has multiple definitions, and remove one of the sources of that definition, preferably from the included CubeMX sources. Good luck!