First of all, many thanks to Jim Fred for describing how to convert the Atollic Eclipse C project to C ++.
I followed the steps, but it did not work. Perhaps because I was not so deep in programming, finally failed.
I will list the steps that I have taken, maybe someone with a lot of Knowledge can help me, or can give some advice on what to do and where to look for additional information about the Topic (Compilation; Linking).
The problem was that I had "unknown type" compiler errors for uint8_t and similar variables.
The solution to this problem was simply to include "stdint-gcc.h".
then the following compiler error occurred:
../Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:186lla: error: #error "First select the target device STM32L4xx used in your application (in the file stm32l4xx.h)"
target selection error
- Looking through the project settings, I noticed that where Hal preprocessor directives for GNU C are installed, I added them to GNU C ++ entries.
added macros to C ++ records
compilation again caused the same error:
../Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:186lla: error: #error "First select the target device STM32L4xx used in your application (in the file stm32l4xx.h)"
target selection error
perhaps because the C compiler and that C ++ compiler compile the same code?
What bothers me is that the c compiler first compiles the files, and after that the files are compiled by the C ++ compiler. Do I need to change the binding settings to bind C and C ++ together?
can this work when all the code is compiled in C ++ directly?
I apologize that my English is not the best. Some help would be very good :) Thanks.
source share