0

dwm で systray を取得しようとしています。DWM はサックレスの X 用動的ウィンドウ マネージャーです: https://dwm.suckless.org/。dwm を構成するには、自分で手動でパッチを追加する必要があります。https://github.com/domianter34/dwm/tree/master/dwmにあるすべてのファイルを含む git リポジトリを作成しましたが、問題は dwm.c ファイルにのみあるようです。また、追加した git リポジトリには、これまでに追加したすべてのパッチが含まれていたため、ストック dwm に対してはパッチを適用しませんでした。また、これを FreeBSD でコンパイルしていますが、この質問の文脈では OS は関係ないと思います。前もって感謝します。

私はCプログラミングについて最初に知らないので、なぜここで質問しているのか. エラーについて読んだところ、どこかでブラケットが欠落していることを示しているようですが、それが私を指している行でも、すべてが順調に進んでいるようです。

正確なエラーは次のとおりです。

rm -f dwm drw.o dwm.o util.o dwm-6.2.tar.gz
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -g -I/usr/local/include -I/usr/local/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA
LDFLAGS  = -L/usr/local/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
CC       = cc
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -g -I/usr/local/include -I/usr/local/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -g -I/usr/local/include -I/usr/local/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c
dwm.c:796:10: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration]
                snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster);
                ^
dwm.c:796:10: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
dwm.c:975:1: error: function definition is not allowed here
{
^
dwm.c:1001:1: error: function definition is not allowed here
{
^
dwm.c:1010:1: error: function definition is not allowed here
{
^
dwm.c:1025:1: error: function definition is not allowed here
{
^
dwm.c:1051:1: error: function definition is not allowed here
{
^
dwm.c:1075:1: error: function definition is not allowed here
{
^
dwm.c:1085:1: error: function definition is not allowed here
{
^
dwm.c:1103:1: error: function definition is not allowed here
{
^
dwm.c:1113:1: error: function definition is not allowed here
{
^
dwm.c:1138:1: error: function definition is not allowed here
{
^
dwm.c:1159:1: error: function definition is not allowed here
{
^
dwm.c:1177:1: error: function definition is not allowed here
{
^
dwm.c:1185:1: error: function definition is not allowed here
{
^
dwm.c:1196:1: error: function definition is not allowed here
{
^
dwm.c:1212:1: error: function definition is not allowed here
{
^
dwm.c:1228:1: error: function definition is not allowed here
{
^
dwm.c:1298:1: error: function definition is not allowed here
{
^
dwm.c:1308:1: error: function definition is not allowed here
{
^
dwm.c:1329:1: error: function definition is not allowed here
{
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
*** Error code 1

Stop.
make: stopped in /usr/home/dominic/Source/dwm

私が望むのは、システムトレイを使用できるように、パッチを適用して正常にコンパイルすることです。

4

1 に答える 1

2

最初に表示されるエラー:

それにかんする:

void
expose(XEvent *e)
{
    Monitor *m;
    XExposeEvent *ev = &e->xexpose;

    if (ev->count == 0 && (m = wintomon(ev->window))) { 
        drawbar(m);
        if (m == selmon)
                   updatesystray();
}

問題を明らかにするために見栄えが書き直されました。

void
expose(XEvent *e)
{
    Monitor *m;
    XExposeEvent *ev = &e->xexpose;

    if (ev->count == 0 && (m = wintomon(ev->window))) 
    {   
        drawbar(m);
        if (m == selmon)
                       updatesystray();
    }
// this is missing, right here,  the final closing brace '}'
于 2019-06-17T14:45:10.230 に答える