moonlight

Related to the development libraries, released by Curt Binder
Post Reply
wijigong
Posts: 51
Joined: Sat Sep 17, 2011 5:03 am

moonlight

Post by wijigong »

what is this error

ReefAngel_Globals\ReefAngel_Globals.cpp.o: In function `MoonPhase()':
C:\Users\tesst\Documents\Arduino\libraries\ReefAngel_Globals/ReefAngel_Globals.cpp:79: multiple definition of `MoonPhase()'
sketch_sep24a.cpp.o:C:\Users\tesst\AppData\Local\Temp\build6435190662415524990.tmp/sketch_sep24a.cpp:290: first defined here
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: moonlight

Post by binder »

wijigong wrote:what is this error

ReefAngel_Globals\ReefAngel_Globals.cpp.o: In function `MoonPhase()':
C:\Users\tesst\Documents\Arduino\libraries\ReefAngel_Globals/ReefAngel_Globals.cpp:79: multiple definition of `MoonPhase()'
sketch_sep24a.cpp.o:C:\Users\tesst\AppData\Local\Temp\build6435190662415524990.tmp/sketch_sep24a.cpp:290: first defined here
That error means that MoonPhase() function is already included with the libraries and you do not need to have it inside your PDE file. So if you have it inside your PDE file, you can either comment it out or delete it out.
You can then use the function as you normally would.

curt
wijigong
Posts: 51
Joined: Sat Sep 17, 2011 5:03 am

Re: moonlight

Post by wijigong »

ok good

but if i remove this on my pde file
how i call the moonlight fonction on my pde file


another question i have the same style of error if i add custom menu on my pde file
with this string

void ConvertNumToString(char* string, int num, byte decimal)
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: moonlight

Post by binder »

wijigong wrote:ok good

but if i remove this on my pde file
how i call the moonlight fonction on my pde file


another question i have the same style of error if i add custom menu on my pde file
with this string

void ConvertNumToString(char* string, int num, byte decimal)
You can still call/use the moonlight function inside your pde file. You just won't have the void MoonPhase(){ .... } lines in your pde.
You just use it like you would normally use it:

value = MoonPhase();

or however it's called.

The same for ConvertNumToString. You remove the void ConvertNumToString(char *string, int num, byte decimal) { .... } code from the top of your pde.
Then you just call the function like normal.

ConvertNumToString(text, 99, 0);


What I have done is incorporate those functions into the libraries so people do not have to copy & paste them into their pde file to use them. They can just call the functions and not worry about adding them in themselves.

curt
Post Reply