如果已經有人問過這個問題,我很抱歉我在網上找不到任何解決方案,我正在嘗試從安裝 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.0:154x ) 的未定義引用:未定義對xcb_flush' swm.o: In function
焦點的引用': swm.c:(.text+0x1ba): 未定義對xcb_get_geometry' swm.c:(.text+0x1d2): undefined reference to
xcb_get_geometry_reply' 的引用 swm.c:(.text+0x4d1): 未定義對xcb_generate_id' swm.c:(.text+0x52f): undefined reference to
xcb_create_pixmap' 的引用。xcb_generate_id' swm.c:(.text+0x561): undefined reference to
xcb_change_gc' swm.c:(.text+0x5a7): undefined reference to
xcb_change_gc' swm.c:(.text+0x5fe): undefined reference to
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:2.定義引用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.xac:(text+00xac:20. ) 的未定義引用: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}