PlatformIO Community

Myself build lib and library.json,how to use other folder header file?

my tree:

├─.pio
├─.vscode
├─include(main.h,lcd1.h)
├─lib
│  └─BLTGUI
│      ├─custom
│      ├─generated(event.c)
│      └─library.json
├─src(main.cpp,lcd1.cpp)
├─test

my library.json is

{
    "name": "BLTGUI",
    "keywords": "bltgui",
    "description": "bltgui des",
    "version": "1.0",
    "authors": {
      "name": "lb"
    },
    "licence": "MIT",
    "frameworks": "arduino",
    "platforms": "espressif32",
    "build" : {
      "unflags": "-std=gnu++11",
      "flags": [
         "-std=c99",
        "-I custom",
        "-I generated"
      ],
      "srcFilter": [
        "+<*.c>",
        "+<custom/*.c>",
        "+<generated/*.c>"
      ]
    }
  }

I want to use lcd1.h in event.c,but it error

so,about two problem,

Q1:file path how to set ?

error info is lcd1.h: No such file or directory

Q2:C how to use CPP ?

It should be a part of user’s platformio.ini. So, if you need from user to add project’s “include” directory to the global CPPPATH that will be accessible for external libs + frameworks, please use the next

[env]
build_flags = -I include