views:

468

answers:

2

It seems weird to me that this answer is hard to find. I've included time.h and ctime, but vc9 is still complaining about an undefined type 'timespec'. I've searched here, MSDN, and the web (even with the exact compiler error), but I can't find the answer... maybe it's just lost in the noise.

Here's the exact error:

error C2027: use of undefined type 'timespec'

Thanks

+3  A: 

struct timespec comes from posix, and are typically found on unixes, but not on windows.

nos
A: 

If you are trying to compile code with a *nix-y provenance under Windows then you might be better off with something like cygwin and gcc, which gives you a *nix-like environment.

Paul R