Every time i getting the same error and i cant fix it . I am trying to write my uart communication as a header file even if i used the extern but it doesnt work , Can somenone help me how to write properly ?
09:32:54 **** Incremental Build of configuration Debug for project uart_deneme ****
make -j8 all
arm-none-eabi-gcc "../Core/Src/myHeader.c" -mcpu=cortex-m0 -std=gnu11 -g -DDEBUG -DUSE_HAL_DRIVER -DSTM32F072xB -c -I../Drivers/STM32F0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Include -I../Core/Inc -I../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F0xx/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/myHeader.d" -MT"Core/Src/myHeader.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/myHeader.o"
In file included from ../Core/Src/myHeader.c:11:
../Core/Inc/myHeader.h:14:8: error: unknown type name 'I2C_HandleTypeDef'
14 | extern I2C_HandleTypeDef hi2c1;
| ^~~~~~~~~~~~~~~~~
../Core/Src/myHeader.c:32:29: error: conflicting types for 'hi2c1'
32 | extern I2C_HandleTypeDef hi2c1;
| ^~~~~
In file included from ../Core/Src/myHeader.c:11:
../Core/Inc/myHeader.h:14:26: note: previous declaration of 'hi2c1' was here
14 | extern I2C_HandleTypeDef hi2c1;
| ^~~~~
make: *** [Core/Src/subdir.mk:40: Core/Src/myHeader.o] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
09:32:55 Build Failed. 3 errors, 0 warnings. (took 654ms)
