C/C++ and Arduino libraries

Hi I am new to Arduino, maybe this question has already been answered but I surfed the forum and found only some information.

What I would like to do is to program my Arduino in C/C++ using Arduino libraries. I found Javier Valcarce personal website (sorry I cant post weblinks!) where he explains how to program a single C program, but it doesn't link with existent (and useful!) arduino libraries. I guess that by studying the arduino Makefile I would find how to do it, but maybe you know about someone already making it ?

Another question is: looking on the Makefile, I don't see any link file (*.lds) telling avr-gcc how to map code into memory. Doy you know how this mapping is done ?

Thanks,

The wesite i cited earlier : http://javiervalcarce.es/wiki/Program_Arduino_with_AVR-GCC

What I would like to do is to program my Arduino in C/C++ using Arduino libraries.

Use the IDE? :slight_smile:

I know it is the simpler solution, but I would like to use both Arduino libraries and third-party C++ libraries and other compile chains ;-)

I do that using Eclipse, see the guide in the playground.

There have been problems with this recently, see that other topic.

The simple steps for setting this up (my way), after installing Eclipse with the C/C++ plugins and the AVR plugin: * create a new project * copy the hardware/cores/arduino directory inside it and either add it as a source folder, or add it to the include path for the C and C++ compiler in the project preferences * remove main.cxx * remove wiring_serial.c (if using libs from 0015+) * create your own main.cpp file and add declaration+definition of void __cxa_pure_virtual(void) (see that other topic again) * make sure to edit the project preferences as described in the playground guide

This setup works fine for me, the only problem (besides that other problem in that other topic) is that the binaries it creates are much larger than the ones created by the Arduino IDE. I am too stupid to find out why. Anyway, the flexibility and power of Eclipse are worth it.