rjdmoore / fictrac

FicTrac: A webcam-based method for tracking spherical motion and generating fictive animal paths.
http://fictrac.rjdmoore.net/
Other
26 stars 29 forks source link

Issue with compilation: sleep(uint) vs sleep(int) #22

Closed fhurtak closed 1 year ago

fhurtak commented 1 year ago

When installing according to the README instructions, compliation fails at

$cmake --build . --config Release -- -j 16

with error

[ 96%] Building CXX object CMakeFiles/fictrac.dir/exec/fictrac.cpp.o /home/hurtak/.local/opt/fictrac/exec/fictrac.cpp: In function ‘int main(int, char)’: /home/hurtak/.local/opt/fictrac/exec/fictrac.cpp:95:10: error: call of overloaded ‘sleep(int)’ is ambiguous 95 | sleep(250); | ~^~~~~ In file included from /home/hurtak/.local/opt/fictrac/exec/fictrac.cpp:9: /home/hurtak/.local/opt/fictrac/include/timing.h:102:13: note: candidate: ‘void sleep(long int)’ 102 | static void sleep(long ms) | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/11/csignal:42, from /home/hurtak/.local/opt/fictrac/exec/fictrac.cpp:14: /usr/include/unistd.h:464:21: note: candidate: ‘unsigned int sleep(unsigned int)’ 464 | extern unsigned int sleep (unsigned int __seconds); | ^~~~~ gmake[2]: ** [CMakeFiles/fictrac.dir/build.make:76: CMakeFiles/fictrac.dir/exec/fictrac.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:139: CMakeFiles/fictrac.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2

The error is solved by editing the calls to sleep, explicitly setting the type of the values to unsigned int.

rjdmoore commented 1 year ago

This is fixed in latest version (see #20)