Cosa: An Object-Oriented Platform for Arduino programming

MarsWarrior, I see that you are back trying to get Cosa up and running on Code::Blocks. Below are a few hints on how to interpret the warning and error messages from the compiler.

  1. The warnings have to do with the PSTR()/PROGMEM macro from AVR. It is not correctly defined in AVR. The same in Arduino. Requires a fix in AVR so for now just ignore "warning: only initialized variables can be placed into program memory area".
  2. The errors are interesting as they reference free_memory() which is very strange. This might have to do with the preprocessing.
  3. The link also seems to miss the object file for the preprocessed .ino file as setup() and loop() are missing.

You need to provide your compiler and link options to make sense of this. Also as I mentioned before this post/topic on this forum is mainly for Cosa updates and not support. Please use the github issue handling instead. I don't really provide support for stuff that is not on the project plan. Sorry about that.

When porting I start with something a bit simpler than CosaPins.ino and work my way upwards. This example sketch does use a lot of Cosa advanced stuff. It is not my first choice when going for a new IDE.

Last, the issue that pito mentioned. It isn't as bad as that. Yes, Cosa is compiled with the Arduino core when a sketch is built for the first time in a session (start of the IDE). A recompile of both the Arduino core and Cosa is forced when a new board is selected. Compiling another sketch in the same session with the same board setting will not force a new build of Cosa (or the Arduino core). All the object files are reused.

Cheers!