identifier not found

Hi
I made a function called jdn_to_time_of_day but get this error
"ut_date_main.cpp(80): error C3861: 'jdn_to_time_of_day': identifier not found"

The function in date.cpp looks like

double Date::jdn_to_time_of_day(jdn_t jdn){
double jdn_time, fractpart, intpart;
//Date now;
//jdn_time=now.jdn();
fractpart = modf(jdn , &intpart);

//cout<< fractpart<<endl;

double hour_in_day=(fractpart*24);
int H = static_cast<int>(hour_in_day);
double min_in_day=modf(hour_in_day,&intpart)*60;
int Min = static_cast<int>(min_in_day);
double sec_in_day=modf(min_in_day,&intpart)*60;
int S = static_cast<int>(sec_in_day);
return (H,":",Min,":",S);
}

I imported to the main by including #include "date.hpp" where it is declared
double jdn_to_time_of_day(jdn_t jdn); in the header file

I called it in the main like this
cout<<jdn_to_time_of_day(2455473.6667);

and when it runs I get the error it is unidentified

Can anyone see what I am doing wrong as the functions above and below it all work fine.
Thanks for any help you can give.
It looks like your jdn_to_time_of_day() function is either part of a namespace Date or a class Date.

If it is a namespace (or a static member function in a class), you must properly qualify the name of the function:

cout << Date::jdn_to_time_of_day(2455473.6667);

If it is a class, you must operate on an object of that class:

1
2
Date d;
cout << d.jdn_to_time_of_day(2455473.6667);

Hope this helps.
Thanks alot. That fixed it.
Topic archived. No new replies allowed.