[solved] Export project with shared libraries

hi all,
sorry if already told ,is it there a way to export a complete project ( I mean with shared libraries ) as zip file?

You mean like right click and zip the entire project folder from your file manager. :stuck_out_tongue:

PS: just saw the note about shared libraries. You do realise that the entire way of handling projects in platformio forces anyone else to use platformio to develop or compile the code even if you give the sources to them. Then platformio.ini file contains the list of libraries it needs to build the project successfully. You are covered on that front.

yes… I mean like right click (:scream:) but with shared libraries, what this kind of handling projects forces doesn’t matter to me.:stuck_out_tongue_closed_eyes:
about platformio.ini…I’m sorry to say that I don’t find any information about shared libraries there… only when I build the project in the log screen there are which libraries are needed ,with full path…:smirk:

When you install libraries you have several ways of handling it. Once is to use the library manager to install libraries per project or globally. The other way is to specify the libraries in the platformio.ini file. This way the entire project information is stored in the initial file. You can zip it and share it. :slight_smile: hope this helps.

Yes this could be a way,(I missed this kind of option installing libraries thank you for the info) but it’s not what I’m looking for…

Just navigate to .pioenvs directory in a project and copy *.a files, they are static compilied libraries.

2 Likes

Ivan ,would you to marry me? :wink:
Thanks a lot.

1 Like

What about headers? How should be project recompiled later?

Just make a private library which contains all headers and lib.a (archive).

I’ve been following this old thread about sharing libraries between projects and I can’t find any directory named .pioenvs in any of my project directories, even those projects that have built successfully. Where should this directory be located in the project structure?

Regarding *.a files, are they supposed to be in the .pioenvs directory? I do see some of these files located under the Build directory.

Rob

This thread is 7 yeras old. Many things have changed during the time.

If you crate a library and compile your project you will get an .a file in the build directory:

β€œMyLib” (located in /lib/MyLib) will end up as β€œMyLib.a” in the directory .pio/build/envname/libXXX:

Environment β€œesp32dev”:

.
β”œβ”€β”€ .pio
β”‚   └── build
β”‚       └── esp32dev
β”‚           └── libcf0
β”‚               β”œβ”€β”€ MyLib
β”‚               β”‚   β”œβ”€β”€ MyLib.cpp.d
β”‚               β”‚   └── MyLib.cpp.o
β”‚               └── libMyLib.a
β”œβ”€β”€ include
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ MyLib
β”‚   β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”‚   β”œβ”€β”€ MyLib.cpp
β”‚   β”‚   β”‚   └── MyLib.h
β”‚   β”‚   └── library.json
β”œβ”€β”€ src
β”‚   └── main.cpp
β”œβ”€β”€ test
└── platformio.ini