How to use external source files in a new project?

Hi, I have two PlatformIO ESP8266 based projects.

First Project

C:\projects\test-01-project
C:\projects\libraries

I used below line in “platformio.ini”

lib_extra_dirs =C:\projects\libraries

In “C:\Projects\test-01-project\src” I have couple of common classes which I thought of reusing those in other projects.

So in second project (c:\projects\tset-02-project), I want to use the source files (CPP, H) from “c:\projects\test-01-project\src\modules” and also include the “c:\projects\libraries” external libraries which are needed by source files in “c:\projects\test-01-project\src\modules”.

I tried different compiler options, but none worked. So can you guys help with this. Thanks.

If you want to reuse some components between differen projects, you sould orginize them as libraries. As you mentioned, you can place them into external library storage and use it later in other proejcts via lib_extra_dirs.