AnsweredAssumed Answered

undefined reference to `time'

Question asked by Armend Gecaj on Aug 26, 2016
Latest reply on Sep 5, 2016 by Armend Gecaj

Hi all,

 

i have a qeustion. Maybe somebody can help me.

 

I wrote an algorithm in the language C. My algorithm create a random labyrinth. I used the function "srand((unsigned)time(NULL));". With this function i ensure that my labyrinth is really random (otherwise i get always the same labyrinth, for more information about "srand((unsigned)time(NULL));" see srand - C++ Reference ).

Additional i add the Header file " #include<stdlib.h> " and " #include<time.h> ". Now i can use the function srand(.......).

 

If i build my algorithm in Microsoft Visual i get no problems.

But if i copy my algorithm in CodeWarrior and build it then i get the problem report " undefined reference to `time' ".

But i used the header file time.h and in microsoft visual it works.

 

Have anybody an idea why i become this problem report in CodeWarrior, and what can i do?

 

 

Thank you very much!

 

Best Regards

Armend

Outcomes