1

I am working on a project with multiple arduinos. I want my folder structure to be as follows:

/
  libs/
    someSharedFile.h
  arduino1/
    arduino1.ino
  arduino2/
    arduino2.ino

When I include someSharedFile.h in one of my .ino files like this #include "../libs/someSharedFile.h", I get this error No such file or directory.

However, when I move libs/ to arduino1 and include the shared file like this #include "libs/someSharedFile.h" everything works fine.

I am using IDE 1.6.7 on windows 10.

1 Answer 1

2

Arduino IDE copies the files to a temp folder. You can see that when you compile in verbose mode.
As such the lib folder is not available.
You should place you libraries in [your home folder]/arduino/libraries

5
  • Thanks for your answer. I was trying to avoid that for git integration. Is there any workaround where the libraries and the main code could be in the same repo?
    – Marcel
    Mar 19, 2016 at 17:47
  • Not that I know of wit the Arduino IDE.
    – jantje
    Mar 20, 2016 at 12:26
  • You could use a symlink that's ignored by git. Why do you need to do this?
    – Anthony
    Mar 20, 2016 at 12:27
  • I am working in a robotics club at school and I want to make it easy for people to get going without having to install a bunch of libraries first.
    – Marcel
    Mar 20, 2016 at 15:25
  • I would advice a better IDE for a robotics club. These can handle these situations and have far better version control integration. Off-course I advice my arduino eclipse plugin. eclipse.baeyens.it
    – jantje
    Mar 20, 2016 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.