time header

I was programming along, like I normally would. When I tried to run my program the time.h popped up with an error. Usually this isn't open. All I did was include.

1
2
#include <ctime>
#include <cstdlib> 


in my program.

The header popped up showing an error on line two of this code..

1
2
3
4
5
6
#ifndef _CLOCK_T_DEFINED
typedef	long	clock_t;
#define _CLOCK_T_DEFINED
#endif

#ifndef _TM_DEFINED 


the error is..

|error: 'long' or 'short' invalid for 'clock_t'|
||=== Build finished: 1 errors, 0 warnings ===|


Normally this wouldn't pop up as a tab on Code::Blocks when I try to run my app. I don't have this file added anywhere. It must be an internal thing code::blocks is doing, but I don't know what I did to cause this, lol.
You did add time.h when you entered, #include<ctime>. It's a standard library that is included in the compiler.

As for why it popped up in a new tab, Code::Blocks does that from time to time. It it attempting to help you resolve your error by showing you the header file that includes the function you are using. Code::Blocks is hoping you can glean enough information from that to solve your specific error. I've never put any thought into figuring out what triggers it, but is sometimes is helpful when it does.
okay, I think I see what caused it. In my header file where my prototypes are I had

function()
function()
function()
void

lol
Topic archived. No new replies allowed.