Hi all, how are you?.
I have a project where I have a function in main but is defined in a header, that header is correctly defined in the project and if I do ctrl + click over the function in the main file, the IDE redirects correcty to the .cpp definition file.
In the status bar there is a message that says “Is not active kit” but when I press that message then it doesn’t find the kit, on the other hand when I try to compile the project then there is a message that says
“incorrect Cmake executable: check that it is installed or check that the value of the variable cmake.cmakepath contains the correct route”.
This happens in a machine with windows 10 Pro 64 bits and Plaftormio Core 6.1.11, Home 3.4.4
the main file calls a function called Compara_RTC, that function is defined in the files called reoj.h nad reloj.cpp and all of them are stored in src folder of the project.
I dissabled the cmake extension and rebuilt the intellisense index, now it didn’t have the problem with cmake but it keeps giving the error that it doesn’t find the definition of my function, I’ve even reinstalled from zero vscode and platformio and the problem remains
in more than one .h fil, i.e. estdado.h and reloj.h. But this include guard macro must be unique.
Since your main.cpp includes estado.h, it gets a #define RELOJ_H definition. When it goes to #include "reloj.h", it does not get any of the function definitions because all of that is inside the #ifndef RELOJ_H (if not defined) block.
In addition to that, you have really bad cyclic dependencies going on. Your backend.h includes reloj.h which includes backend.h (???). That’s not good practice at all.
I would recommend a major refactor in which you cleanly separate the type definitions into one header file, and that should not include any other file. You also have to get rid of the circular dependency by exactly introducing a third file.