Pros c++ library

Ive read the pros cli guide at how to create templates. It only teaches how to create one but doesnt teach how to order the files. After days of investigation, ive found out that you have to put all h files in the includes folder. But how is the rest configured? here is my normal file structure:


How should i organise them to create a library?
How do i create and apply the library?

From the page with info about creating templates:

The default behavior of pros make template is to compile/package all source files in your project, except for those listed in EXCLUDE_SRC_FROM_LIB . Additionally, any header files which you have created will be bundled. More concisely, any header files which weren’t added by a template are included.

1 Like

since

TEMPLATE_FILES=$(INCDIR)/**/*.h $(INCDIR)/**/*.hpp

does that mean all the h and hpp files i want to be passed on to the new project has to be in the includes library?(incdir)

Yes, that’s where header files go in a PROS project anyway. Note also that you can change the variable to be whatever you want. For instance, see the relevant lines in the PROS kernel template.

Actually in general if you’d like to see a reference for how a template can be organized, just check out the PROS kernel, which is itself a template.

oh thats why all the c and cpp files of the pros kernel is in the src foldder and all the h and hpp is in the includes, and also that we can only see h/hpp files in the includes folder and a o file in the firmware folder.