You are not logged in.

#1 2013-05-16 05:41:08

Svetlina
Member
Registered: 2013-05-15
Posts: 4

[Solved] DWM and xft trouble

Hi, applying xft patch gives me some errors so i thought someone here might help me. What i have done so far is...

abs community/dwm
cp -r /var/abs/community/dwm ~/dwm
cd ~/dwm
makepkg -i

then i download xft patch from dwm website and applied it like this

patch -p1 < path/to/patch.diff

It askd me which file i want to patch so i pointed out /home/user/dwm/src/dwm-6.0/dwm.c
Ok then i add -I/usr/include/freetype2 to CFLAGS and -lfreetype to LDFLAGS in ~/dwm/src/dwm-6.0/config.mk then

cd dwm
updpkgsums
makepkg -efi

And here i end with

==> Making package: dwm 6.0-1 (Wed May 15 13:37:05 EEST 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing src/ tree
==> Removing existing pkg/ directory...
==> Starting build()...
dwm build options:
CFLAGS   = -I/usr/include/freetype2 -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -lfreetype -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC       = cc
CC dwm.c
dwm.c: In function ‘keypress’:
dwm.c:1062:2: warning: ‘XKeycodeToKeysym’ is deprecated (declared at /usr/include/X11/Xlib.h:1695) [-Wdeprecated-declarations]
  keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
  ^
CC -o dwm
dwm.o: In function `getcolor':
dwm.c:(.text+0x994): undefined reference to `XftColorAllocName'
dwm.o: In function `textnw':
dwm.c:(.text+0xabe): undefined reference to `XftTextExtentsUtf8'
dwm.o: In function `drawtext':
dwm.c:(.text+0xcdc): undefined reference to `XftDrawCreate'
dwm.c:(.text+0xd33): undefined reference to `XftDrawStringUtf8'
dwm.c:(.text+0xd3b): undefined reference to `XftDrawDestroy'
dwm.o: In function `main':
dwm.c:(.text.startup+0x115): undefined reference to `XftFontOpenName'
dwm.c:(.text.startup+0x138): undefined reference to `XftFontOpenName'
collect2: error: ld returned 1 exit status
make: *** [dwm] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by Svetlina (2013-05-16 15:21:36)

Offline

#2 2013-05-16 14:35:03

lennyt
Member
Registered: 2013-04-03
Posts: 10

Re: [Solved] DWM and xft trouble

could you post a link to your dwm.c? (upload it to some hosting site, not here please)

Offline

#3 2013-05-16 14:40:12

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [Solved] DWM and xft trouble

Add '-lXft' to LIBS in config.mk.

Offline

#4 2013-05-16 15:03:43

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [Solved] DWM and xft trouble

jakobcreutzfeldt wrote:

Add '-lXft' to LIBS in config.mk.

That, and also -lutil and -lXext.

Or, you can just go ahead and grab buildflags.diff and 01-dwm-6.0-xft.diff from my GitHub wink

https://github.com/Unia/DWM


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#5 2013-05-16 15:13:50

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [Solved] DWM and xft trouble

Unia wrote:

That, and also -lutil and -lXext.

Hmm...those weren't necessary for me.

Offline

#6 2013-05-16 15:21:02

Svetlina
Member
Registered: 2013-05-15
Posts: 4

Re: [Solved] DWM and xft trouble

Here's my dwm.c

Jakob and Unia's solution solved the problem anyway.
Thank you very much guys, you are awesome!

Offline

#7 2013-05-16 15:44:06

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [Solved] DWM and xft trouble

jakobcreutzfeldt wrote:
Unia wrote:

That, and also -lutil and -lXext.

Hmm...those weren't necessary for me.

I think I have always used them - just assumed they were necessary. Now I have to look into it! tongue

Cheers!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#8 2013-05-16 16:04:53

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [Solved] DWM and xft trouble

Unia wrote:
jakobcreutzfeldt wrote:
Unia wrote:

That, and also -lutil and -lXext.

Hmm...those weren't necessary for me.

I think I have always used them - just assumed they were necessary. Now I have to look into it! tongue

Cheers!

Ha! You were right, they're not necessary. Now I wonder how I ever picked up on them...


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

Board footer

Powered by FluxBB