gabrielzschmitz / Tomato.C

A pomodoro timer written in pure C.
GNU General Public License v3.0
315 stars 19 forks source link

Is there able to use brew to install mpv and libmpv? #39

Closed xbunax closed 5 months ago

xbunax commented 5 months ago

I use brew to install mpv and set the PKG_CONFIG_PATH in zshrc but it's still unable to complie.

cc -std=c99 -Wall -Wextra -pedantic -Wunused-result -Wno-unused-variable -Os -D_ISOC99_SOURCE -DTOMATONOISE=\"/opt/local/bin/tomatonoise\" -DLOGPREFIX=\".local/share/tomato\" -DLOGFILE=\".local/share/tomato/tomato.log\" -DTMPFILE=\".local/share/tomato/tmp.log\" -DTIMERFILE=\".local/share/tomato/time.log\" -DNOTEPADFILE=\".local/share/tomato/notepad.log\" -I/opt/local/include -L/opt/local/lib  tomatonoise.c  -lncurses -lmpv -o tomatonoise
tomatonoise.c:1:10: fatal error: 'mpv/client.h' file not found
#include <mpv/client.h>
         ^~~~~~~~~~~~~~
1 error generated.
make: *** [tomatonoise] Error 1

I try to use macports but the same problem still happens. This is my system info

                    'c.          xbunax@MacBook-Air-3.local
                 ,xNMM.          --------------------------
               .OMMMMo           OS: macOS 14.4 23E214 arm64
               OMMM0,            Host: Mac14,2
     .;loddo:' loolloddol;.      Kernel: 23.4.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 12 hours, 30 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 1 (port), 206 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1920x1080, 1470x956
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Amethyst
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    Terminal: iTerm2
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal Font: MesloLGS-NF-Regular 14
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   CPU: Apple M2
    kMMMMMMMMMMMMMMMMMMMMMMd     GPU: Apple M2
     ;KMMMMMMMWXXWMMMMMMMk.      Memory: 2748MiB / 16384MiB
       .cooc,.    .,coo:.
gabrielzschmitz commented 5 months ago

What shows up when you use:

$ whereis libmpv.so
xbunax commented 5 months ago

What shows up when you use:

$ whereis libmpv.so
 whereis libmpv.so                                                             
libmpv.so:

but I find the client.h

image
gabrielzschmitz commented 5 months ago

You didn't install the libmpv, try installing with the Macports, as the README suggests

$ sudo port install mpv +libmpv
xbunax commented 5 months ago

You didn't install the libmpv, try installing with the Macports, as the README suggests

$ sudo port install mpv +libmpv

Yes, I try to use ports to install libmpv before submit the issue but the problem is still occured. And I still try to close the sound before complie this programe.

static const int SOUND = 0;
static const int NOISE = 0;

However , I'm still unable to complie this programe.

Password:
cc -std=c99 -Wall -Wextra -pedantic -Wunused-result -Wno-unused-variable -Os -D_ISOC99_SOURCE -DTOMATONOISE=\"/opt/local/bin/tomatonoise\" -DLOGPREFIX=\".local/share/tomato\" -DLOGFILE=\".local/share/tomato/tomato.log\" -DTMPFILE=\".local/share/tomato/tmp.log\" -DTIMERFILE=\".local/share/tomato/time.log\" -DNOTEPADFILE=\".local/share/tomato/notepad.log\" -I/opt/local/include  -c -o input.o input.c
input.c:735:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 1) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:739:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 2) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:743:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 3) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:747:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 4) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
4 errors generated.
make: *** [input.o] Error 1
gabrielzschmitz commented 5 months ago
input.c:735:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 1) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:739:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 2) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:743:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 3) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:747:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 4) && (event.bstate & BUTTON5_PRESSED))
                                                     ^

This look like a error with ncurses. What

$ whereis ncurses.h

says?

xbunax commented 5 months ago
input.c:735:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 1) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:739:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 2) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:743:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 3) && (event.bstate & BUTTON5_PRESSED))
                                                     ^
input.c:747:54: error: use of undeclared identifier 'BUTTON5_PRESSED'
      if ((app->printVolume == 4) && (event.bstate & BUTTON5_PRESSED))
                                                     ^

This look like a error with ncurses. What

$ whereis ncurses.h

says?

whereis ncurses.h
ncurses.h:

I have use brew to install ncurses and add into env path and pkgconfig path.

gabrielzschmitz commented 5 months ago

Try using MacPorts instead too:

$ sudo port install ncurses
xbunax commented 5 months ago

Try using MacPorts instead too:

$ sudo port install ncurses

I don't want to use macports, so I use docker install this successfully. Thanks to your help.

gabrielzschmitz commented 5 months ago

Oh! my bad, I hadn't realized that you don't want to use MacPorts. Does the docker install goes all right?

xbunax commented 5 months ago

Oh! my bad, I hadn't realized that you don't want to use MacPorts. Does the docker install goes all right?

Yes,It works well without sound , but this is enough for me. Thanks , you are kindly.