![无法在 Ubuntu 15.04 上安装 swm](https://linux22.com/image/1127710/%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%2015.04%20%E4%B8%8A%E5%AE%89%E8%A3%85%20swm.png)
如果这个问题已经被问过了,我很抱歉,我在网上找不到任何解决方案,我正在尝试从安装 swm这里,但我在终端中运行 make 时一直收到此错误
c99 swm.o -o swm -lxcb -L/opt/X11/lib -L/usr/X11R6/lib swm.o: 在函数
cleanup': swm.c:(.text+0x1b): undefined reference to
xcb_disconnect' 中 swm.o: 在函数deploy': swm.c:(.text+0x43): undefined reference to
xcb_connect' 中 swm.c:(.text+0x59): 对xcb_connection_has_error' swm.c:(.text+0x76): undefined reference to
xcb_get_setup' 未定义的引用 swm.c:(.text+0x7e): 对xcb_setup_roots_iterator' swm.c:(.text+0xd2): undefined reference to
xcb_grab_button' 未定义的引用 swm.c:(.text+0x114): 对xcb_grab_button' swm.c:(.text+0x145): undefined reference to
xcb_change_window_attributes_checked' 未定义的引用 swm.c:(.text+0x154): 对xcb_flush' swm.o: In function
focus' 未定义的引用: swm.c:(.text+0x1ba): 对 xcb_get_geometry_reply' 未定义的引用xcb_get_geometry' swm.c:(.text+0x1d2): undefined reference to
swm.c:(.text+0x4d1): 对xcb_generate_id' swm.c:(.text+0x52f): undefined reference to
xcb_create_pixmap'未定义的引用swm.c:(.text+0x53e): 对xcb_generate_id' swm.c:(.text+0x561): undefined reference to
xcb_create_gc' 未定义引用 swm.c:(.text+0x586): 对xcb_change_gc' swm.c:(.text+0x5a7): undefined reference to
xcb_poly_fill_rectangle' 未定义引用 swm.c:(.text+0x5dd): 对xcb_change_gc' swm.c:(.text+0x5fe): undefined reference to
xcb_poly_fill_rectangle' 未定义引用 swm.c:(.text+0x625): 对xcb_change_window_attributes' swm.c:(.text+0x639): undefined reference to
xcb_free_pixmap' 未定义引用 swm.c:(.text+0x64d): 对xcb_free_gc' swm.c:(.text+0x675): undefined reference to
xcb_set_input_focus' 未定义引用 swm.o: 在函数subscribe': swm.c:(.text+0x6fd): undefined reference to
xcb_change_window_attributes' 中 swm.c:(.text+0x722): 对xcb_configure_window' swm.o: In function
events_loop' 未定义引用: swm.c:(.text+0x765): 对xcb_wait_for_event' swm.c:(.text+0x807): undefined reference to
xcb_kill_client' 未定义引用 swm.c:(.text+0x858): 对xcb_map_window' swm.c:(.text+0x8c8): undefined reference to
xcb_configure_window' swm.c:(.text+0x8dc): 对xcb_get_geometry' swm.c:(.text+0x8f4): undefined reference to
xcb_get_geometry_reply' 未定义的引用 swm.c:(.text+0x957): 对xcb_warp_pointer' swm.c:(.text+0x9aa): undefined reference to
xcb_warp_pointer' 未定义的引用 swm.c:(.text+0x9ee): 对xcb_grab_pointer' swm.c:(.text+0xa01): undefined reference to
xcb_flush' 未定义的引用 swm.c:(.text+0xa20): 对xcb_query_pointer' swm.c:(.text+0xa38): undefined reference to
xcb_query_pointer_reply' 未定义的引用 swm.c:(.text+0xa5c): 对xcb_get_geometry' swm.c:(.text+0xa74): undefined reference to
xcb_get_geometry_reply' 未定义的引用 swm.c:(.text+0xbce): 对xcb_configure_window' swm.c:(.text+0xbdd): undefined reference to
xcb_flush' 未定义的引用 swm.c:(.text+0xc02): 对xcb_get_geometry' swm.c:(.text+0xc1a): undefined reference to
xcb_get_geometry_reply' 未定义的引用 swm.c:(.text+0xc72): 对xcb_configure_window' swm.c:(.text+0xc81): undefined reference to
xcb_flush'未定义的引用swm.c:(.text+0xca8): 对xcb_ungrab_pointer' swm.c:(.text+0xcf8): undefined reference to
xcb_flush' 未定义引用 collect2: 错误:ld 返回 1 退出状态 Makefile:18:目标“swm”的配方失败 make:*** [swm] 错误 1
有什么建议么?
答案1
我明白了!你需要将第 19 行Makefile
改为
@${LD} -o $@ ${OBJ} ${LDFLAGS}