NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 24 forks source link

Error Compiling : "src/ctpv.c:2:10: fatal error: magic.h: No such file or directory" #34

Open Fryni5 opened 1 year ago

Fryni5 commented 1 year ago

I use Void Linux I installed libmagic, ImageMagick, ImageMagick-devel I looked into #23 and I didn't find the packages mentioned there, I'm lost thanks in advance!

info: *sudo make install make -C embed make[1]: Entering directory '/home/zorya/git/ctpv/embed' make[1]: 'embed' is up to date. make[1]: Leaving directory '/home/zorya/git/ctpv/embed' cc -o src/ctpv.o src/ctpv.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter src/ctpv.c:2:10: fatal error: magic.h: No such file or directory 2 | #include | ^~~~~ compilation terminated. make: ** [Makefile:55: src/ctpv.o] Error 1

Erothas commented 1 year ago

I can confirm this error happening in both my Arch and Void Linux machines. It seems like author has gone MIA. Especially since his name is very Russian. Let's hope he comes back safely.

Fryni5 commented 1 year ago

Yes, everyone has his own problems, I hope he comes back safely. And for the problem mentioned above, I did specify the path to magic.h in the Makefile's CFLAGS -I/path/to/magic.h (you can find it by using locate command), the error is gone but then when I tried to compile it again I got 3 terminal pages of errors and I don't know where to start again.

NikitaIvanovV commented 1 year ago

Nothing bad happened to me, I was busy at my work. :)

Try solutions from here: #4.

emagaram commented 1 year ago

This happened for me as well, #4 wasn't helping. I have libmagic installed but not file-devel since I'm on MacOS.

NikitaIvanovV commented 1 year ago

This happened for me as well, #4 wasn't helping. I have libmagic installed but not file-devel since I'm on MacOS.

I'm pretty sure it's possible to get libmagic devel files on macOS because someone has apparently done it: #43

suhailskhan commented 1 year ago

@emagaram Depending on the package manager you used to install libmagic, you may need to use compilation flags to make sure the compiler can see the necessary headers. However, if you are only looking to install ctpv, recently it was made available in the MacPorts package repository, so you could simply use MacPorts to install ctpv and its dependencies with sudo port install ctpv. In the future I have plans to submit ctpv to the Homebrew package repository as well, in case you prefer Homebrew.

NikitaIvanovV commented 1 year ago

@suhailskhan Thank you for maintaining the package! I really appreciate it! Please open a PR with installation instructions. It will help other people easily copy-paste a command and install the program. You can use my instructions for Arch Linux as a reference.

suhailskhan commented 1 year ago

@NikitaIvanovV Done. See #49.