Error unknown type name 'HAL_LockTypeDef'
1. I create a project in CubeMX.
2. Imported into SW4STM32.
3. The compilation is completed without errors.
4. I create in the project c-file gyro_l3gd20.с.
5. I add only 4 lines to it:
#include ‹main.h›
#include ‹stm32f3xx_hal_gpio.h›
#include ‹stm32f3xx_hal_spi.h›
#include ‹sys/_stdint.h›
6. I compile. And I get 100 errors like: unknow type name ‘HAL_StatusTypeDef’ stm32f3xx_hal.h / L3GD20_SPI / Drivers / STM32F3xx_HAL_Driver / Inc line 863 C / C ++ Problem
7. I comment on lines 2 and 3:
#include ‹main.h›
// #include ‹stm32f3xx_hal_gpio.h›
// #include ‹stm32f3xx_hal_spi.h›
#include ‹sys/_stdint.h›
8. The project is compiled without errors.
What am I doing wrong?
I attach a log with errors and a c-file.