How do I build (get/download) time.h library?

coffeenet picture coffeenet · Jun 18, 2012 · Viewed 14.7k times · Source

I am trying to build a project on Linux via Makefile.

I keep getting cannot find <sys/time.h> error.

I asked around, and I was told that my project doesn't have access to library folders.

Therefore, I am trying to solve this problem by using the time library locally inside my project's folder. I am very new to Linux. So, please forgive my question if it sounds naive.

I found this, but I don't know what files I need, and how to build the library. http://sourceware.org/git/?p=glibc.git;a=tree;f=time;h=c950c5d4dd90541e8f3c7e1649fcde4aead989bb;hb=master

  • Where can I find the time.h library/package?
  • How do I build the library?

Answer

tripleee picture tripleee · Jun 18, 2012

On Debian-derived distributions, apt-get install libc6-dev will get the required header files. You will need them for pretty much any C project. In the general case, Debian package search or apt-file can tell you where to find missing library etc files.