My team has a C++ program from another microcontroller that we are moving to Arduino, which is currently divided into two main folders, the sketch and libraries. We want to be able to open some of the library files in the Arduino IDE along with the sketch, something it will do automatically if they are in the same folder, but not allow otherwise. The files in question are referenced from the other libraries though, which means moving just a few of them results in compilation errors. We don't want to move them all to the sketch folder, since that defeats the purpose, but a few of my teammates are vehemently opposed to having to edit them using another IDE.

So is there a way to have these files open in the Arduino IDE with the sketch? Or do I have to tell my teammates to suck it up and use a second editor if they want to make changes?

Alternatively, a way to get the libraries able to reference files in the sketch folder would also work.

  • What IDE did they use for the other micro controller? Commented Sep 26, 2014 at 4:57
  • @geometrikal They were PIC32s, so we used the MPLAB X IDE, which everyone universally disliked.
    – ltab
    Commented Sep 26, 2014 at 15:20
  • I've just started moving a project over to netbeans. It was tricky at first but I think it would be much better than the Arduino IDE for a team. Commented Sep 26, 2014 at 22:38

1 Answer 1


I don't recommend this

A) Because the arduino editor is pretty bad for serious coding

B) Because you will need to have a header guard on all library code that doesn't have one already (even in .cpp's)

But, if you really have to, the only way I can think of is to make a symbolic link to the library file in the sketch directory. It works, but the file gets compiled twice, so you need those header guards on everything.

  • Yeah, I think everyone agrees on that. But I guess they hate alt+tabbing that much more. I'll look into symbolic links then; the headers all have guards already so that shouldn't be too much of an issue.
    – ltab
    Commented Sep 26, 2014 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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