cgccrenderwindow-managerswayland

Compiler does not find wlr_backend_get_renderer when I have already included backend


I am trying to write a Wayland compositor based on Wlroots, and I am following the description given on Drew Devault's weblog. When I add the last changes in the page for rendering, my compilation leads to errors:

undefined reference to `wlr_backend_get_renderer'
undefined reference to `wlr_output_make_current'
undefined reference to `wlr_output_swap_buffers'

I compile my code which is exactly the one on the website, by this command:

gcc -o file file.c -I/usr/include/pixman-1/ -lwlroots -lwayland-server -lxkbcommon -DWLR_USE_UNSTABLE

Thanks for any help and sorry if it is a really stupid question.


Solution

  • So, after checking some wayland compositors that update more often like Waybox and Sway, I found how to fix this problem. These functions do not exist in the newer version of wlroots and therefore one has to use their more recent replacements. As for the rendering, waybox uses wlr_renderer_autocreate instead of wlr_backend_get_renderer. For the other two, I just tried working with the output function in waybox which uses allocators and so I avoided the problem that way. Unfortunately, wlroots has very poor documentation and they expect you to learn by looking at the code, I guess! Therefor, I do not have detailed explanation on how I solved this problem, but, I put my code online in my github. This code is suppose to be tinywl without some capabilities with some updates for some depricated and outdated functionalities. Hope this helps people in future.