When compiling dwm6.1 , the following error appears:

 eanmos@pc:~/documents/dwm-6.1$ sudo make install dwm build options: CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.1" -DXINERAMA LDFLAGS = -s CC = cc CC drw.c In file included from drw.c:6:0: /usr/include/X11/Xft/Xft.h:39:22: fatal error: ft2build.h: No such file or directory compilation terminated. Makefile:18: recipe for target 'drw.o' failed make: *** [drw.o] Error 1 

xlibxinerama-dev, libxft-dev, libfreetype6-dev installed. The ft2build.h file ft2build.h present in the /usr/include/freetype2/ folder

Contents of the config.mk file:

 # dwm version VERSION = 6.1 # Customize below to fit your system # paths PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man X11INC = /usr/X11R6/include X11LIB = /usr/X11R6/lib # Xinerama, comment if you don't want it XINERAMALIBS = -lXinerama XINERAMAFLAGS = -DXINERAMA # freetype FREETYPELIBS = -lfontconfig -lXft FREETYPEINC = /usr/include/freetype2/ # OpenBSD (uncomment) FREETYPEINC = ${X11INC}/freetype2 # includes and libs +INCS = -I${X11INC} -I/usr/include/freetype2 +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} -lutil -lXext -lXft -lfontconfig # flags CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = -s ${LIBS} # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" #LDFLAGS = ${LIBS} # compiler and linker CC = cc 

Makefile content:

 # dwm - dynamic window manager # See LICENSE file for copyright and license details. include config.mk SRC = drw.c dwm.c util.c OBJ = ${SRC:.c=.o} all: options dwm options: @echo dwm build options: @echo "CFLAGS = ${CFLAGS}" @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" .co: @echo CC $< @${CC} -c ${CFLAGS} $< ${OBJ}: config.h config.mk config.h: @echo creating $@ from config.def.h @cp config.def.h $@ dwm: ${OBJ} @echo CC -o $@ @${CC} -o $@ ${OBJ} ${LDFLAGS} clean: @echo cleaning @rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz dist: clean @echo creating dist tarball @mkdir -p dwm-${VERSION} @cp -R LICENSE TODO BUGS Makefile README config.def.h config.mk \ dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} @tar -cf dwm-${VERSION}.tar dwm-${VERSION} @gzip dwm-${VERSION}.tar @rm -rf dwm-${VERSION} install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @cp -f dwm ${DESTDIR}${PREFIX}/bin @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 @sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin @rm -f ${DESTDIR}${PREFIX}/bin/dwm @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1 .PHONY: all options clean dist install uninstall 

    1 answer 1

     +INCS = -I${X11INC} -I/usr/include/freetype2 +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} -lutil -lXext -lXft -lfontconfig 

    here there is an obvious semantic error - after all, later the variable INCS and LIBS , and not +INCS and +LIBS (yes, in gnu / make these are valid variable names).

    most likely, the person who wrote these lines wanted to add information to the values ​​of variables using the += operator:

     INCS += -I${X11INC} -I/usr/include/freetype2 LIBS += -L${X11LIB} -lX11 ${XINERAMALIBS} -lutil -lXext -lXft -lfontconfig 

    illustration of the described:

     переменная = начальное значение переменная += добавка +переменная = хитрое имя переменной цель: @echo $(переменная) @echo $(+переменная) 

    when you call make, output:

    initial value
    tricky variable name

    • Thank you very much! - eanmos