TCHunt-ng icon indicating copy to clipboard operation
TCHunt-ng copied to clipboard

Doesn't build on OSX

Open contentfree opened this issue 7 years ago • 2 comments

After installing libmagic and glib from brew, running make fails:

$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src/
cc -O3 -std=gnu99 -pedantic -Wall -ggdb -c -o test.o test.c
test.c:63:28: error: no member named 'st_atim' in 'struct stat'
                timebuff.actime = fstat->st_atim.tv_sec;
                                  ~~~~~  ^
test.c:64:29: error: no member named 'st_mtim' in 'struct stat'
                timebuff.modtime = fstat->st_mtim.tv_sec;
                                   ~~~~~  ^
2 errors generated.
make[1]: *** [test.o] Error 1
make: *** [all] Error 2

Likely due to a POSIX incompatibility. Maybe a similar patch as mentioned at https://sourceforge.net/p/optipng/bugs/47/ would work?

contentfree avatar Nov 16 '17 01:11 contentfree

@contentfree I am unable to test for OSX, however I have pushed a new branch https://github.com/antagon/TCHunt-ng/tree/1.4 with minor changes to the source code that reflect on structure of struct stat as described here: https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/sys/stat.h.auto.html.

It would be of great help if you could compile the new version found in a branch 1.4 and report back.

antagon avatar Nov 16 '17 12:11 antagon

@antagon: The 1.4 branch compiles and appears to work. Thanks!

contentfree avatar Nov 22 '17 18:11 contentfree