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 need to be able to compile a piece of code at work that was originally written for Unix based systems. I am using cygwin and the GNU gcc. Every time I try to run the make command, the program seems to compile as it should but when it gets to timing.h it produces this error:
Compiling: timing.c timing.h... timing.c:1:0: warning: -fPIC ignored for target
(all code is position independent)
#include "timing.h"
In file included from timing.c:1:0:
timing.h:5:26: fatal error: sys/resource.h: No such file or directory
#include <sys/resource.h>
compilation terminated.
timing.h:1:0: warning: -fPIC ignored for target (all code is position independent)
#include <sys/time.h>
timing.h:5:26: fatal error: sys/resource.h: No such file or directory
#include <sys/resource.h>
compilation terminated.
make: *** [timing.o] Error 1
From what I have read, usually the cause of this kind of error is caused by an incorrect path. The contents of timing.h are as follows:
#include <sys/time.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/resource.h>
void timing(double* wcTime, double* cpuTime);
The thing that baffles me is that even-though the files are in the same directory I only get the error as it tries to include the last file. I have made sure that the $C_INCLUDE_PATH points to where the files are.
$ echo $C_INCLUDE_PATH
/usr/include/
Any help would be awesome. This has stumped me for a few days now. I am running gcc version 4.9.0.
–
–
–
Your cygwin /usr/include/sys directory appears to be missing the resource.h file.
I just checked my cygwin installation and resource.h and time.h are both present in /usr/include
You might be missing a cygwin package, or your cygwin installation may need to be updated.
–
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.