79491840

Date: 2025-03-07 09:44:15
Score: 1
Natty:
Report link

Apparently the free function is in the stdlib.h library and I just needed to add it to my c_imports like this:

const c = @cImport({
    @cInclude("xcb/xcb.h");
    @cInclude("stdlib.h");
});

Then, I changed all the xcb. to c. in the code and added c.free(event) at the end of the loop.

I ran zig build but there was a problem with compiler not finding free again. Finally, I understood that I have to add exe.linklibC(); to my build.zig so that it could work. It now runs and there is no major issue. There are only some warnings that I need to understand:

The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86RefreshRateToggle
> Warning:          Could not resolve keysym XF86Accessibility
> Warning:          Could not resolve keysym XF86DoNotDisturb
Errors from xkbcomp are not fatal to the X server
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: mortimer