Arduino : multiple lib versions managment

Sysprogs forums Forums VisualGDB Arduino : multiple lib versions managment

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #23106
    christophe
    Participant

    Hi,

    I would like to know how to manage the version of a lib I want to use in a projet.

    I’ve multiple version of the same library in the xxx\Documents\Arduino\Libraries.

    If I create a new projet, i can add a reference to a specific library version, but it doesn’t seem using the version i pointed out.

    Furthermore, If i import an existing project that use libraries, i’m not able to change the reference to another version.

     

    How can i deal with that ?

     

     

    • This topic was modified 5 years, 4 months ago by christophe.
    #23111
    support
    Keymaster

    Hi,

    Arduino build tools automatically discover the libraries inside the search path based on the header files referenced in the sketches. If you would like to use several versions of the same library, please place it outside the regular library search directories and then explicitly add the parent directory of the library to the per-project library search path (first page of VisualGDB Project Properties).

    Let us know if you need more details and we will be happy to help.

    #23112
    christophe
    Participant

    I’ve only see a way to add extra libr directory, not how to replace the main parent directory.

    BTW, I’ve the same kind of issue for the platform HW too

     

     

    #23113
    support
    Keymaster

    Hi,

    The default library directories are specified via Tools->VisualGDB->Arduino Settings. You can try removing the main directory there and specifying it for each project separately.

    If this is not what you are looking for, please provide more details: the layout of your files and the exact outcome you would like to achieve (i.e. which libraries should be used by each project).

    #23116
    christophe
    Participant

    Hi,

    The settings of the parent path in Tools->VisualGDB->Arduino Setting are global setting, not per project.

    For example, I’ve a project that use the AdruinoJson, but only compatible with the v5. If i updated to the latest one, th eproject doesn’t compile anymore. I would like to specify which version i can use. A workaround would be copying all libraries i use in a separate directory and pointing it as the parent lib path for my projet

     

    #23140
    support
    Keymaster

    Hi,

    Thanks for clarifying this. VisualGDB uses original Arduino build tool (arduino-builder) to discover the libraries. This is done to ensure 100% compatibility and interoperability the Arduino IDE and other command-line build tools.

    To our best knowledge, arduino-builder does not support referencing a specific version of the library, so the only way to achieve that would be to remove the library from the regular search path and add it to the project-specific search path. Another option would be to just rename the old library (e.g. to ArduinoJsonV5) and rename the header file accordingly. Once you use the new header file name in your sketch, Arduino builder (and VisualGDB) will automatically locate the correct version of it.

    #24527
    christophe
    Participant

    For info (and a kind of feature request) :

    I recently try PlatfomIo as VS Code extension to build Arduino projet. The advantage over Arduino IDE and the VisualGDB extension is that PlatformIO is able to manage private Package/libraries stored in specific directory in the project itself. So it is easily possible to have a self-contain project without any trouble of newtest/updated librairies not compatible anymore.

    Before building the final sketch, PlatformIO compiles all private libraries (as C lib), and link them to the final compilation.

    I will be really happy to have such feature in VisualGDB as well (and enventually the ability to import PlatformIO project directly)

     

     

    #24532
    support
    Keymaster

    Hi,

    VisualGDB allows specifying per-project library directories (see VisualGDB Project Properties -> Arduino -> Extra library directories), so you should be able to achieve the same outcome by using this setting.

    If it it doesn’t work, please let us know and we will help.

    We also have long-term plans for supporting PlatformIO projects with VisualGDB as well, although it’s hard to name a specific timeline for it yet.

    #24540
    christophe
    Participant

    Hi,

    I’ve tested and it is almost working: the build process takes the default libs first. So, if you want to build a project with a private older library, it takes the local one instead the private one.

    It will be great if the build process could take the private one first (or having a checkbox to force to take in account only the private (per-project) ones)

     

     

     

    #24558
    support
    Keymaster

    No problem, please try this build: VisualGDB-5.4.104.3057.msi

    We have added an option under VisualGDB Project Properties -> Arduino to ignore the default library paths.

    #24568
    christophe
    Participant

    Working great ! It is now easier to bring back PlatformIO project in VS + VSGdb.

     

    Thanks a lot.

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