it compiles despite the many errors

The library: Ephemeris 1.01

The code requires a Mega. it has to be posted as an attachment, it exceeds the post size limit:

the part that fails:

void printSolarSystemObjects(int day, int month, int year, int hour, int minute, int second)
{
  Serial.println("_____________________________________");
  printPlanet("Sun",          Sun,     day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Mercury",      Mercury, day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Venus",        Venus,   day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Earth",        Earth,   day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Earth's Moon", EarthsMoon,   day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Mars",         Mars,    day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Jupiter",      Jupiter, day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Saturn",       Saturn,  day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Uranus",       Uranus,  day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
  printPlanet("Neptune",      Neptune, day, month, year, hour, minute, second);
  Serial.println("_____________________________________");
}

the failure message, which is repeated for every line that begins with “printPlanet(…”:

/home/username/Arduino/ephemeris_full_failure_blocked/ephemeris_full_failure_blocked.ino: In function 'void printSolarSystemObjects(int, int, int, int, int, int)':
/home/username/Arduino/ephemeris_full_failure_blocked/ephemeris_full_failure_blocked.ino:107:78: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   printPlanet("Sun",          Sun,     day, month, year, hour, minute, second);

but it compiles.

the second strange thing: if all you want is the sun, so you include only

[code]void printSolarSystemObjects(int day, int month, int year, int hour, int minute, int second)
{
  Serial.println("_____________________________________");
  printPlanet("Sun",          Sun,     day, month, year, hour, minute, second);
}

you get a different error message

ephemeris_full.ino (5.9 KB)

That is normal and happens a lot.

When there is a pointer to constant data that is used as a parameter for a function without ‘const’, then the compiler must convert the pointer for constant data to a pointer for normal data. It is the same pointer and nothing changes, but the compiler does not like that. When the function does not use that pointer to write data, then you can add the ‘const’ keyword to the pointer.

Try to add ‘const’ to the pointer:

void printPlanet(const char *solarSystemObjectName, SolarSystemObjectIndex index, int day, int month, int year, int hour, int minute, int second )

What sometimes happens, is that such a function calls another function with that pointer. Then that other function must also get the ‘const’ for the pointer, until all functions down the line are fixed.

that worked

You need to understand the difference between warnings and errors. A warning is the compiler telling you there is something in the code that could possibly cause a problem but doesn't cause the compilation to fail. An error is a problem with the code that causes compilation to fail. In this case you have posted warnings, not errors, and not "failure messages".

You should always pay attention to warnings and fix them in your own code whenever possible. Unfortunately some library authors don't hold themselves to such high standards so sometimes you do just need to ignore a warning from a library that you didn't write. That can be quite annoying since you are always having to sort though a bunch of warnings in other people's sloppy code to make sure your own code is of high quality. You may decide it's worth editing the source of the library to fix the warning. If you do so, it's a good idea to submit a pull request for the fix to the library's repository to solve the problem upstream, otherwise the warnings will come back whenever you update to a new release of the library. This will also benefit all the other users of the library.