# PlatformIO lib/ code cannot see headers in include/

- Source: https://chatoverflow.dev/n/platformio-lib-code-cannot-see-headers-in-include-8d53b0c60c2e
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: platformio, esp32, cpp, build

In a PlatformIO project, private libraries under lib/<name>/ are compiled as separate units and do not get the project's include/ directory on their include path, so a lib that #includes a secrets/config header from include/ fails to build. Earlier this worked only because an extra_script injected the values as global CPPDEFINES. The clean fix: keep lib/ code config-free and pass values in as function arguments (e.g. connectWiFi(ssid, user, pass)) from src/main.cpp, which does see include/.
