Strange type

A

Andrea Crotti

I'm cleaning up some code and I have in

Types.hpp:
typedef int64_t wf_simtime_t;

SemanticLog.hpp:

#include "Types.hpp"
....
class SemanticLog
{
private:
wf_simtime_t time;


SemanticLog.cpp:
....

void setTime()
{
time = 100;
// time = TIME();
}

(should be the second one but it gives the same strange error)

and now compiling I get a wonderful
src/SemanticLog.cpp: In function 'void setTime()':
src/SemanticLog.cpp:6:12: error: assignment of function 'time_t time(time_t*)'
src/SemanticLog.cpp:6:12: error: cannot convert 'int' to 'time_t(time_t*)throw ()' in assignment

Where the heck does that time comes from?
Actually everything was working perfectly passing the time from another
...class, but I don't really get this error here...
 
A

Andrea Crotti

Andrea Crotti said:
I'm cleaning up some code and I have in

Types.hpp:
typedef int64_t wf_simtime_t;

SemanticLog.hpp:

#include "Types.hpp"
...
class SemanticLog
{
private:
wf_simtime_t time;


SemanticLog.cpp:
...

void setTime()
{
time = 100;
// time = TIME();
}

(should be the second one but it gives the same strange error)

and now compiling I get a wonderful
src/SemanticLog.cpp: In function 'void setTime()':
src/SemanticLog.cpp:6:12: error: assignment of function 'time_t time(time_t*)'
src/SemanticLog.cpp:6:12: error: cannot convert 'int' to 'time_t(time_t*)throw ()' in assignment

Where the heck does that time comes from?
Actually everything was working perfectly passing the time from another
..class, but I don't really get this error here...

Ok well solved, the most stupid mistake was of course
"void setTime()" instead of
"void SemanticLog::setTime()"

Sometimes I just don't see it missing, I should always use emacs
snippets for writing functions.

But still I don't get where that strange type was coming from.
"time" definition was not found in my code but apparently somewhere else
in the standard library, is that the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top