I’m trying to create a C program in the CodeBlocks IDE (on Windows), and something I need is the library . When I try and build and run, this line errors:
#include <sys/times.h>
What do I do? Is that a Unix library? Can I download it and just add it somehow to my CodeBlocks environment? I mean, is already there.
Thank you for any help.
Remove -ansi compilation flag from
Settings>Compiler and Debugger>Compiler Optionsin Code::Blocks. If that does not help,<sys/times.h>is unavailable under Windows.Edit:
sys/times.his a part of the POSIX library. POSIX headers are not available under MinGW, and need Cygwin. time.h is a standard ANSI header. If you want to continue usingsys/times.hon POSIX-compliant systems, what you could do instead to ensure portability isReference: time.h