I’m encountering a persistent issue with the include path configuration in my PlatformIO workspace, and I’m seeking assistance in troubleshooting the problem.
Here are the details of my setup and the steps I’ve taken so far:
I have a PlatformIO workspace for my C++ project, which includes multiple source files in the src directory. I created a certificates folder within the workspace to store additional resource files, such as headers and certificates. I added the resources folder to the include path in the .vscode/c_cpp_properties.json file using the following configuration:
{
"configurations": [
{
"name": "PlatformIO",
"includePath": [
"[fullpath]/certificates"
],
...
}
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"[fullpath]/certificates"
],
...
}/**",
I also added the include paths in the platformio.ini file as follows:
[env]
src_dir = src
include_dir = include
lib_dir = lib
data_dir = data
test_dir = test
lib_deps_dir = .pio
board = ...
build_flags =
-I${workspaceFolder}certificates
Despite these configurations, I’m encountering the error message fatal error: SpotifyCer.h: No such file or directory when trying to compile my main.cpp file. Interestingly, I can resolve the issue by using a relative include path like #include “…/certificates/SpotifyCer.h”, but this is not the desired solution.
Here are the troubleshooting steps I’ve already attempted:
Checked that the SpotifyCer.h file exists in the resources folder and that the filename is correct. Verified that the include directive in main.cpp is correctly specified as #include “SpotifyCer.h”. Confirmed that the paths are correctly added in both .vscode/c_cpp_properties.json and platformio.ini files. Restarted the IDE (Visual Studio Code) to ensure changes are recognized. Checked for hidden characters or formatting issues in the files. Cleaned and rebuilt the project to ensure changes are applied. Unfortunately, none of these steps have resolved the issue.
If anyone has encountered a similar problem with include paths in a PlatformIO workspace or has any suggestions for further troubleshooting, I would greatly appreciate your assistance. Thank you in advance for your help!