Problems compiling with Atmel Studio

Hi. Lately my Arduino code's been running large in lines, so I've decided to switch to Atmel Studio for a more organized IDE (plus simulation!). As per the link on the Arduino Playground ( I went over Engblaze's tutorial and I was succcessful! Atmel Studio now compiles and uploads Arduino code to my Uno.

However, I didn't like the fact that I had to include the Arduino core library in its archive form (core.a or libcore.a) in the project. I wanted the library to be included as source files into my project, so that, as a curious man, while developing my project I can look into those files to see exactly what the Arduino functions do, and how they do it. So I modified my Atmel Studio project by 1) removing the libcore library and its corresponding search path in the project's linker settings, and 2) adding all the .cpp and .c files from the \hardware\arduino\cores\arduino\ & \hardware\arduino\cores\arduino\avr-libc\ directories into my project. I figured Atmel Studio would automatically form the library from these files during the build process - afterall, if you watch Arduino's own terminal output, Arduino uses the same files to create the core.a library first, then links to it the Arduino code file. Problem is, when I build my project after all this, I get the error "pins_arduino.h: No such file or directory" from line 9 of the Arduino.h file. I don't get it. What went wrong and how can it be fixed? I already have the directory containing the pins_arduino.h file included in my compiler settings. So why this error?

I’m not sure why you have to go to all that trouble. If you are using Visual Micro (and why wouldn’t you :)) you right-click on the #include filename and click “Goto Implementation” (or just type Alt-G).

That will bring up the code for the file. Normally of course you only have .H files included but as a kludge you can type say

#include <SD.cpp>

in your code then to the above to load the source file.

Or you can just load a file with File>open

Mind you this may all work without VM, I’ve not tried it.


That's nice, but I don't really care about the trouble involved. I want to have the confidence that I can do this.