Re: [dev] Linking against rt in dwm

From: Lee Fallat <ircsurfer33_AT_gmail.com>
Date: Mon, 7 Jul 2014 23:23:35 -0400

On Mon, Jul 7, 2014 at 10:59 PM, Eric Pruitt <eric.pruitt_AT_gmail.com> wrote:
> I'm attempting to write a patch for dwm that uses clock_gettime(3), but
> I cannot figure out how to get librt properly linked to the build.
>
> In config.mk, I changed the LIBS variable:
>
> -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS}
> +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} -lrt
>
> Inside dwm, I also have the include for time.h. However, when I attempt
> to compile dwm with my patch, I get the following warning and error:
>
> dwm build options:
> CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.1"
> LDFLAGS = -s -L/usr/X11R6/lib -lX11 -lrt
> CC = cc
> [...]
> dwm.c:1451:3: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
> dwm.c:1451:21: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
>
> What am I doing wrong?
>
> Thanks,
> Eric
>
Do you have the right #include statements? Show us your patch as if
you were about to submit it so someone can help you :)
Received on Tue Jul 08 2014 - 05:23:35 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 08 2014 - 05:36:03 CEST