milaq / XMousePasteBlock

Userspace tool to disable middle mouse button paste in Xorg
385 stars 18 forks source link

Unable to build on Kubuntu 22.04 #21

Closed Ted-Barrett closed 7 months ago

Ted-Barrett commented 2 years ago

Running make produces the following output:

gcc "xmousepasteblock.o"  -lev -o "xmousepasteblock"
/usr/bin/ld: xmousepasteblock.o: in function `init_xinput':
xmousepasteblock.c:(.text+0x42): undefined reference to `XQueryExtension'
/usr/bin/ld: xmousepasteblock.c:(.text+0x87): undefined reference to `XIQueryVersion'
/usr/bin/ld: xmousepasteblock.o: in function `init_eventmask':
xmousepasteblock.c:(.text+0x170): undefined reference to `XISelectEvents'
/usr/bin/ld: xmousepasteblock.c:(.text+0x17f): undefined reference to `XFlush'
/usr/bin/ld: xmousepasteblock.o: in function `clear':
xmousepasteblock.c:(.text+0x1bc): undefined reference to `XSetSelectionOwner'
/usr/bin/ld: xmousepasteblock.c:(.text+0x1d5): undefined reference to `XStoreBytes'
/usr/bin/ld: xmousepasteblock.c:(.text+0x1f3): undefined reference to `XSetSelectionOwner'
/usr/bin/ld: xmousepasteblock.c:(.text+0x207): undefined reference to `XSync'
/usr/bin/ld: xmousepasteblock.o: in function `check_cb':
xmousepasteblock.c:(.text+0x270): undefined reference to `XNextEvent'
/usr/bin/ld: xmousepasteblock.c:(.text+0x2b9): undefined reference to `XGetEventData'
/usr/bin/ld: xmousepasteblock.c:(.text+0x2fe): undefined reference to `XFreeEventData'
/usr/bin/ld: xmousepasteblock.c:(.text+0x30d): undefined reference to `XPending'
/usr/bin/ld: xmousepasteblock.o: in function `main':
xmousepasteblock.c:(.text+0x34a): undefined reference to `XOpenDisplay'
/usr/bin/ld: xmousepasteblock.c:(.text+0x410): undefined reference to `XConnectionNumber'
collect2: error: ld returned 1 exit status
make: *** [Makefile:42: xmousepasteblock] Error 1

I added LDFLAGS += -lX11 to the makefile, which fixed some of it, but still get this error:

gcc "xmousepasteblock.o"  -lev -lX11 -o "xmousepasteblock"
/usr/bin/ld: xmousepasteblock.o: in function `init_xinput':
xmousepasteblock.c:(.text+0x87): undefined reference to `XIQueryVersion'
/usr/bin/ld: xmousepasteblock.o: in function `init_eventmask':
xmousepasteblock.c:(.text+0x170): undefined reference to `XISelectEvents'
collect2: error: ld returned 1 exit status
make: *** [Makefile:43: xmousepasteblock] Error 1

I have installed the packages suggested in the README. I have been unable to find a solution as it seems like the things which have undefined references are included in the c file appropriately.

Ted-Barrett commented 2 years ago

should point out this is using the 1.3 release archive

nick99nack commented 1 year ago

Make sure you have pkg-config installed first. I ran into the same issue on Debian and noticed I didn't have that installed.

milaq commented 7 months ago

Fixed by https://github.com/milaq/XMousePasteBlock/commit/d62365edfb84e2221dc219878125b22161570967