osx - cmake failed building project on mac -


i'm trying build project on new macbook built on linux computers.

at first when run cmake, following:

-- c compiler identification clang 5.1.0 -- cxx compiler identification clang 5.1.0 -- check working c compiler: /usr/bin/cc -- check working c compiler: /usr/bin/cc -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi info - done -- performing test have_clock_gettime -- performing test have_clock_gettime - failed -- boost version: 1.55.0 -- found following boost libraries: --   graph -- not find doxygen (missing:  doxygen_executable)  -- -> doxygen not found -> api-doc not created -- configuring done -- generating done -- build files have been written to: /path/to/folder 

and when run make, works till around 30% , stop error:

/path/to/project/lib/helpers.cpp:555:2: error: use of undeclared identifier 'gettimeofday'         gettimeofday(&tv, null);         ^ 1 error generated. make[2]: *** [lib/cmakefiles/genom.dir/helpers.cpp.o] error 1 make[1]: *** [lib/cmakefiles/genom.dir/all] error 2 make: *** [all] error 2 

i looked online, there suggestions changing clock_gettime(clock_realtime, &t); clock_get_time(clock_realtime, &t);

but didnt work.

the error message provided indicates gettimeofday wasn't included. clock_gettime has not possible information provided.

a quick search yields, gettimeofday should available (it's part of posix). do have #include <sys/time.h>(apple docs) or #include <sys/types.h>(so answer)?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -