Menu

#230 error: use of undeclared identifier 'CLOCK_MONOTONIC'

v1.0_(example)
open
nobody
None
5
2025-04-14
2017-01-05
No

xfe 1.42 builds fine on macOS 10.12 but fails to build on OS X 10.11 and earlier with:

../st/st.c:979:3: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
                clock_gettime(CLOCK_MONOTONIC, &now);
                ^
../st/st.c:979:17: error: use of undeclared identifier 'CLOCK_MONOTONIC'
                clock_gettime(CLOCK_MONOTONIC, &now);
                              ^
../st/st.c:4032:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &last);
                      ^
../st/st.c:4057:17: error: use of undeclared identifier 'CLOCK_MONOTONIC'
                clock_gettime(CLOCK_MONOTONIC, &now);
                              ^
1 warning and 3 errors generated.
make[2]: *** [../st/st.o] Error 1

Here's a full build log:

https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/14410/steps/install-port/logs/stdio

Discussion

  • Roland Baudin

    Roland Baudin - 2019-06-08

    I managed to install MaOSX in a virtual machine, but how do you compile Xfe in this system? Do you have some instructions to share?
    Thanks.

     
  • J G Miller

    J G Miller - 2025-04-14

    I got this error when compiling with gcc-13 (on openSUSE Leap 15.6) using C standard "c11"

    On invoking gcc-13 with -std=gnu11, this error did not arise.

    It seems that gnu11 pulls in some extra defines that are not included with just c11.

     

Log in to post a comment.

MongoDB Logo MongoDB