Search code examples
c++ceclipsearduinoavr

How do I the add path to a 3rd party library? - Eclipse/Arduino


This is my first time coding in C++ and I have no experience with compiler languages.

I am creating an Arduino project using Eclipse. I want include a 3rd party library. I need to add the path of the library in Eclipse but don't know how. The documentation I found said that I should look at the following:

Project --> Properties --> C/C++ General --> Paths and Symbols

but as you can see in the image Paths and Symbols does not exist. I used the the filter bar to search for Paths and did not get any relevant results. The libraries tab also does not let me add the package in any manner.

I think this is because Arduino uses an AVR compiler and not the cross gcc toolchain. If I create a normal C++ package I can add the path to another library. However, I have not yet figured out how to get it to compile for the Arduino.

How can I add the path to the Arduino project direct eclipse to the 3rd party library that I am using?

enter image description here


Solution

  • Turned out to be really simple. In short you do not need to add the path of the library to eclipse.

    //If you use:
    <header.hpp> //Eclipse looks at the current directory
    //but you could instead say
    <path-to-header/header.hpp>
    

    This eliminates the need to add the path to eclipse via the methods mentioned by everyone else