views:

621

answers:

2

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

+3  A: 

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.

unwind
I have added the right header filesMy question now is how to associate cygwin and the dev-cppI would like to compile and debug my program in dev-cpp using the linux APIsIs there any way?come on, help me
flankechen
A: 

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

flankechen