Question

how to use Linux lib such as timeval in windows I have installed cygwin and dev c++ I don't like compliling in cygwin compliling under dev c++ always erro like `gettimeofday' undeclared (first use this function)

unfortunately, I don't have enough harddisk space to install a linux or any vitual machine

thanks a lot

Was it helpful?

Solution

You can't use Linux code straight away in Windows, of course.

But it seems you're trying to do this using Cygwin, which should support the Linux/POSIX APIs.

If the error you're getting is a compile-time (and not linker) error, you probably are missing the proper header file:

   #include <sys/time.h>

These are documented on gettimeofday()'s man page.

OTHER TIPS

after all it seems that we cann't use linux lib directly in windows my cygwin sugffers from all kinds of problems finally I install vmware, a vitual linux machine and done that which may be not a wise way but a practical one

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top