Problem on compiling afind on Windows

For scripts to aid with computation or simulation in cellular automata.
Post Reply
Bullet51
Posts: 663
Joined: July 21st, 2014, 4:35 am

Problem on compiling afind on Windows

Post by Bullet51 » July 5th, 2015, 5:04 am

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!
Still drifting.

User avatar
gmc_nxtman
Posts: 1150
Joined: May 26th, 2015, 7:20 pm

Re: Problem on compiling afind on Windows

Post by gmc_nxtman » August 3rd, 2015, 9:44 am

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.
Attachments
afind.zip
(51.42 KiB) Downloaded 362 times

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Problem on compiling afind on Windows

Post by Scorbie » August 3rd, 2015, 10:29 am

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...

Post Reply