Arduino project Referenced Libraries missing sub folders for Source files

Sysprogs forums Forums VisualGDB Arduino project Referenced Libraries missing sub folders for Source files

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22816
    dazipe
    Participant

    Arduino project Referenced Libraries have two virtual folders “Source files” and “Header files”.

    If I expand “Header files” I can see the header files and all sub folders. If I open sub folder I can see the nested files and folders.

    However it doesn’t work for the “Source Files” folder. It only lists the *.cpp files located in root folder of the library and there is no sub folders.

    I’m using VisualGDB 5.4 preview 7.

    #22828
    support
    Keymaster

    Hi,

    This could be caused by your library not using the “src” folder format. Please refer to the Arduino library specification for details.

    #22846
    dazipe
    Participant

    Hello,

    I’m using TFT_eSPI library downloaded in Arduino IDE with the library manager. It is working and compiling fine. It is one of the most popular display library and I did not modify it.

    The file I wanted to debug located in /Extensions folder and it is included as “Extensions/Smooth_font.cpp”

    So the Arduino can include files from sub folders..

    This looks like a bug from in your IDE. Since, like I mentioned, the Header File virtual folder has all the sub folders of the project.

    #22847
    dazipe
    Participant

    Also there is a note in the link you provided:

    “For backward compatibility with Arduino 1.0.x, the library author may opt to place source code into the root folder, instead of the folder called src. In this case the 1.0 library format is applied and the source code is searched from the library root folder and the utility folder, for example:”

    #22849
    dazipe
    Participant

    I checked and it behaves the same way when I move everything in the “src” folder.

    No sub folders displayed for “Source Files”

    It is a bug!

    I’m now on the latest VisualGDB 5.4 preview 10.

    #22861
    support
    Keymaster

    Hi,

    Thanks for sharing details about the library; we will try to clarify what is going on.

    VisualGDB gets the list of Arduino source files to show in Solution Explorer directly from the Arduino tools – it is exactly the same files that participate in the build. As header files do not participate in the build directly, VisualGDB simply scans the source directories for headers and shows them in Solution Explorer as well.

    Specifically for the TFT_eSPI library, the TFT_eSPI.cpp file is the only source file that actually participates in the build of the sketch. You can double-check this by searching for .o files in the Output\SparkFun_ESP32_Thing\Debug\libraries\TFT_eSPI directory. The Extensions/smooth_font.cpp file is actually not compiled directly, instead it’s #included-d from the main source file:

    #ifdef SMOOTH_FONT
     #include "Extensions/Smooth_font.cpp"
    #endif

    We might eventually be able to show the included files in Solution Explorer as well (they could be queried using our Clang IntelliSense engine), although we won’t promise any specific deadlines for this as it would require a fairly large change on our side.

    Hope this explains. Let us know if you have any further questions.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.