Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I was trying to install/compile libraries such as igraph and SNAP in Windows 7 using Cygwin (and also tried MinGW-MSYS) and I ran into some problems.
I think I have narrowed down the problem to this error given by
./configure
:
checking sys/times.h usability... no
checking sys/times.h presence... no
checking for sys/times.h... no
In Cygwin, /usr/include/sys/times.h
actually do exists. I googled about this for MinGW and it seems that sys/times.h is not available for MinGW because "the POSIX/BSD "times" function is not part of the ANSI standard and does not exist under Mingw32 runtime".
As an experiment, I tried compiling this C code in Cygwin using gcc:
#include <stdio.h>
#include <sys/times.h>
int main (void)
return 0;
This does not compile, with the error sys/times.h no such file or directory
. This happens even when I change the include to </usr/include/sys/times.h>
or <usr/include/sys/times.h>
. In the Cygwin command promot /usr/include/sys/times.h
work correctly.
Question
How do I get sys/times.h usability and presence? Is there a package or library I can install?
–
Your code compiles with no problem on my Cygwin. Actually /usr/include
is one of the default include search paths for gcc, so normally gcc should be able to find sys/times.h
.
Perhaps you are using MinGW version of gcc instead of Cygwin gcc? Try which gcc
to make sure it's /usr/bin/gcc
, and also gcc --version
to make sure it does not display like mingw32-gcc.exe (GCC) x.x.x
.
You can also try to compile your C file with verbose output:
gcc -v test.c
It shows how gcc searches include files. /usr/include
should be one of the search path list if you use Cygwin's gcc.
–
–
–
–
–
As I found out, there seems to be some intrinsic problems with this issue, and sys/times.h is not supposed to be used under windows (not supported for some reason).
As I mentioned also here, it's use should actually be removed from the code to make it compile.
I had this same problem. Delete the folder C:\cygwin64 . Reinstall cygwin. Choose all defaults but when you get to 'Select Packaages', make sure to search and select the following one by one: binutils , make , gcc-g++ . For each one, select the dropdown and change form 'skip' to the newest version. Continue until you complete the installation. Everything worked for me from there.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.