Implicit dependency error when using "pio run"

When I use pio run to compile a test program (main.cpp) I get the following error:

*** [lib\CLI.pio\build\wemos_d1_mini32\firmware.elf] Implicit dependency C:\Users\User\.platfo========rmio\platforms\espressif32\builder\src' not found, needed by target lib\CLI.pio\build\wemos_d1_mini32\firmware.elf’.`

I have the following directory structure:

+---.pio
|   +---build
|   |   \---wemos_d1_mini32
|   |       +---FrameworkArduino
|   |       +---lib06e
|   |       |   \---BluetoothSerial
|   |       +---libe96
|   |       |   \---SimpleCLI
|   |       |       \---c
|   |       \---src
|   \---libdeps
|       \---wemos_d1_mini32
|           \---SimpleCLI
|               +---.github
|               |   \---workflows
|               +---examples
|               |   +---BoundlessCommand
|               |   +---ESP8266WebCLI
.
.
|               \---src
|                   \---c
+---example
+---lib
|   \---CLI
|       \---.pio
|           \---build
|               \---wemos_d1_mini32
|                   +---FrameworkArduino
|                   |   \---libb64
|                   +---lib06e
|                   |   \---BluetoothSerial
|                   +---lib86d
|                   |   \---SimpleCLI
|                   |       \---c
|                   \---src
\---src
	|cli.cpp
	|cli.h
	|main.cpp
library.json
platformio.ini

platformio.ini contains:

; PlatformIO Project Configuration File
[env:wemos_d1_mini32]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
lib_deps =
spacehuhn/SimpleCLI@^1.1.3
build_src_filter = +<*> -<Temp files\>
monitor_speed = 115200
build_flags =
-Wl,-Map,output.map
-I include src/
-I ../../include
debug_tool = esp-prog
upload_protocol = esp-prog
monitor_filters = esp32_exception_decoder
build_type = debug
[platformio]
description = Common libraries for IoT projects based on esp32
build_dir = lib/CLI/.pio/build

library.json contains:

{
  "name": "CLI",
  "version": "1.0.0",
  "description": "A task that provides Command Line Interpreter and Serial printf functions via UART and Bluetooth",
  "keywords": "CLI, Bluetooth, printf",
  "authors":
  [
    {
      "name": "David Norbury",
      "email": "david@norburys.me.uk",
      "url": "http://norburys.me.uk",
      "maintainer": true
    }
  ],
  "license": "MIT",
  "dependencies": {
    "spacehuhn/SimpleCLI": "~1.1.3",
    "BluetoothSerial": "1.0"
  },
  "frameworks": "*",
  "platforms": "*"
}

I can’t see where the reference to builder/src comes from and so am finding it impossible to track down the source of the problem.

Any help is appreciated.

This looks weird. A lib/CLI folder that only has a .pio folder?

Hi. I am trying to feel my way into how to structure my project in order to separately test the different modules of which CLI is the first. The folder lib/CLI/.pio was created automatically, when I used ‘pio run’ (in the folder lib/CLI)

Oh I see, because you set the build directory to that. That’s not… normal. Delete that line so that it’s again in .pio/build/$PIOENV and move the library’s source files into lib/CLI.

Thanks for your reply.

In the end the fault was that the build flags line “-I include src/” was (now) obviously wrong!