Hi!
(There already are some topics on similar questions, I read through them and attempted their advice, but I cannot make it work, so please bear with me )
I made some algorithms/classes in .h/.cpp files that live in their own folders. These folders also have âmainâ files in them, so that I can run the algorithms to test them/work on them. This all is NOT on platformIO, but simply using C++ in VSC.
Now I want to use these .h and .cpp files in a platformIO project, so that I can upload them to a MCU. The way I thought this would work is by using the platformio.ini
file:
[env:ATmega4809]
platform = atmelmegaavr
board = ATmega4809
framework = arduino
lib_deps =
olikraus/U8g2@^2.33.15
lib_extra_dirs = C:/XXXXXX/XXXXXX/software/algorithms/Cplusplus/gravity_angle
lib_ldf_mode=chain+
In the gravity_angle
file are the headerFile.h and Cplusplus.cpp files in question.
Now I thought, from reading the other forum questions, the c_cpp_properties.json
file would now show this directory in its include path, and I would be able to use #include "headerFile.h"
to link to this headerFile.
But it does not show up in c_cpp_properties.json
, and the â#include errors detected.â error shows up
What am I doing wrong here? And is this the correct way of doing what I want anyway? Or am I making it more complicated than needed?
Any help is greatly appreciated!
Chris