3 ms·
Cool! Or, warm depending on parameter. On Ubuntu includes are apparently broken, complaining about strings.h included from Xlibint.h ... There's probably a ya
by taneliv 11y ago
Cool! Or, warm depending on parameter.
On Ubuntu includes are apparently broken, complaining about strings.h included from Xlibint.h ...
There's probably a yak to shave in that. However, if you're lazy and hit the same problem, you can compile a functional sct by lifting declarations of i and c outside their loops and dropping "-std=c99" from the command line.
- protopete 11y agoI was able to compile it on Ubuntu after moving the X11 includes to the bottom of the list: #include <stdio.h> #include <strings.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> #include <stdarg.h> #include <math.h> #include <X11/Xlib.h> #include <X11/Xlibint.h> #include <X11/Xproto.h> #include <X11/Xatom.h> #include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrender.h>
- hiimnate 11y agoI also had to do some fiddling with the includes (removing the `strings.h` include got it working for me. Why is this required?
- ploxiln 11y agoHistorically, including some headers ended up including some other headers automatically, such that the author might not realize what headers the file depends on, because it compiles without them explicitly included. glibc (and maybe gcc and xlib?) have been cleaning this up where possible, slowly over time. So a file that had "correct enough" includes for an older glibc might now be caught not including a header it needed all along. Or maybe it's a similar situation but actually related to "feature test macros" (see https://lwn.net/Articles/590381/ https://lwn.net/Articles/590381/)
- diqu 11y agoThank you, had the same problem on Debian. This made it work.
- pdw 11y agoJust remove the Xlibint.h include. That's internal Xlib stuff, it's not needed.
- taneliv 11y agoAh, no yak shaving was necessary, cheers.