You are not logged in.
SOLVED.
For anyone who trying to build swc, how is it going ? Im trying to build it but I got this error :
libswc/shell_surface.c:58:1: error: conflicting types for ‘close’; have ‘void(struct window *)’
58 | close(struct window *window)
| ^~~~~
In file included from /usr/include/bits/sigstksz.h:24,
from /usr/include/signal.h:328,
from /usr/include/sys/param.h:28,
from libswc/util.h:34,
from libswc/shell_surface.c:32:
/usr/include/unistd.h:358:12: note: previous declaration of ‘close’ with type ‘int(int)’
358 | extern int close (int __fd);
| ^~~~~
make: *** [common.mk:15: libswc/shell_surface.o] Error 1
Any clue? Thanks.
Last edited by AhmadRaniri (2022-02-28 03:26:18)
Offline
Why are you trying to build swc? It's been effectively abandonned for years having been superceeded by wlroots.
In any case, there error is quite clear, the shell_surface implementation has a poorly-chosen function name that conflicts with a unistd function. The best option would be to rename the shell_surface function. Alternatively, if unistd isn't really needed, then perhaps removing the include of unistd.h would suffice ... but I'm pretty sure it's there for a reason.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
glibc-2.34 included https://github.com/bminor/glibc/commit/ … 816bf51d53 so https://github.com/michaelforney/swc/bl … util.h#L34 now includes unistd.h
util.h needs sys/param.h for MAX used by https://github.com/michaelforney/swc/bl … util.h#L89
shell_surface.c which includes util.h defines close which clashes with the definition from unistd.h same with libswc/xdg_shell.c.
I would suggest you try renaming the local close functions to something else such as close_window. That seems simplest to me as the functions are not exported.
Or wait for upstream to fix the issue.
Offline
Thanks... I'll dig it deeper.
Offline
Why are you trying to build swc? It's been effectively abandonned for years having been superceeded by wlroots.
It's still active though.
Offline
I would suggest you try renaming the local close functions to something else such as close_window. That seems simplest to me as the functions are not exported.
Or wait for upstream to fix the issue.
I'll try it thanks.
Offline
SOLVED.
Offline