Trying to port Arduino library (C++ library ) to STM32 CubeIDE (C project)
- August 5, 2020
- 3 replies
- 4725 views
Hi all!
I used to "work" with Arduino environment in the past. Now I passed to Eclipse based IDE and in this specific case I'm using STM32CUBEIDE to develop a C project for an F100 series MCU.
In the Arduino world I used often a library written in C++ (header file and cpp file) and I would really like to use the same library in this case too, obviously with the due modification because of the different hardware but it's not this the point.
This is the library: https://github.com/mathertel/OneButton
In order to do that I added 2 new files in my project called say mylib.h and mylib.cpp. Than I copied the original library code in theese files. I also included the header file in main.c and build the project but I get the following errors:
I believe the problem is in the C++ language and I have to say I've never used C++ in STM32CUBEIDE so maybe I miss some steps...
p.s. the errors are in the images