You are not logged in.

#1 2022-02-28 01:01:26

AhmadRaniri
Member
Registered: 2020-07-14
Posts: 36

[SOLVED] Swc package.

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

#2 2022-02-28 02:05:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED] Swc package.

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

#3 2022-02-28 02:09:18

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: [SOLVED] Swc package.

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

#4 2022-02-28 02:21:20

AhmadRaniri
Member
Registered: 2020-07-14
Posts: 36

Re: [SOLVED] Swc package.

Thanks... I'll dig it deeper.

Offline

#5 2022-02-28 02:22:46

AhmadRaniri
Member
Registered: 2020-07-14
Posts: 36

Re: [SOLVED] Swc package.

Trilby wrote:

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

#6 2022-02-28 02:24:15

AhmadRaniri
Member
Registered: 2020-07-14
Posts: 36

Re: [SOLVED] Swc package.

loqs wrote:

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

#7 2022-02-28 03:24:08

AhmadRaniri
Member
Registered: 2020-07-14
Posts: 36

Re: [SOLVED] Swc package.

SOLVED.

Offline

Board footer

Powered by FluxBB