Page 1 of 1

Problem on compiling afind on Windows

Posted: July 5th, 2015, 5:04 am
by Bullet51
I have succeeded in compiling afind on a mac,but my gcc in Windows always give me the error message:

Code: Select all

C:\Dev-Cpp\bin>g++ afind.c
afind.c:39:26: sys/resource.h: No such file or directory
afind.c: In function `int main(int, char**)':
afind.c:1763: error: `PRIO_PROCESS' undeclared (first use this function)
afind.c:1763: error: (Each undeclared identifier is reported only once for each function it appears in.)
afind.c:1763: error: `setpriority' undeclared (first use this function)
afind.c:1807:78: warning: no newline at end of file
Can anyone help me find out what is going wrong?
Thanks!

Re: Problem on compiling afind on Windows

Posted: August 3rd, 2015, 9:44 am
by gmc_nxtman
I will upload both a raw executable, and a .exe file below. I'll also upload an example file to use as an input. I hope this helps.

Re: Problem on compiling afind on Windows

Posted: August 3rd, 2015, 10:29 am
by Scorbie
I don't know much about the details, but googling says <sys/resource.h> is not available for Windows.
However, I noticed that <sys/resource.h> is only used to set priorities when the program is running on the background, so you can just disable the background feature, run it in the foreground, and forget about <sys/whatever.h>.

One-Line summary: I was able to compile after commenting line 17:

Code: Select all

// #define BACKGROUND
Hope that helps. Good luck.

EDIT: gmc's version doesn't seem to work on my machine...