cross compile for Windows and for Arduino


My objective is to to run the 'same' C/C++ code on the Arduino Mega and in a command prompt window under XP, for debugging and demonstration purposes.

As fas as I know Visual Studio Express or MingW/Msys has the capability to create Win XP console applications, while the Arduino IDE works great compiling for AtMega.

Anyone have a success story to share regarding the above?

Thanks, Rich.

I used mingw alongside the arduino ide to work my way through a c++ primer. The thing that was hardest to deal with was native c++ i/o vs arduino serial. Things like c++ exception handling i had to code my way around and some of the subtleties like sizeof(int) just never showed up.


After getting lot's of error messages from Visual Studio Express, I was able to finally get VS to compile and run a console application using the vspde files from

I used Windows XP and Visual Studio C++ 2010 Express Edition.

The console application doesn't run properly (yet), but at least I got it to compile and run. Bill, like you said, it's the i/o that will be the issue

The key to using the Express Edition is 'Project, Properties, Additional Include Directories', which then prevents the fatal error C1083.

I wrote up the steps, if I can figure out how to attach a file, I'd be interested to hear feedback. Sorry that the serial program doesn't work right.....

cheers, RichB


looks like I can’t easily attach a file.

send an email if you’d like to receive the pdf file of instructions.

cheers, RichB